patchGNU Octave - Patches: patch #8010, Change workspace row height to 20...

 
 

patch #8010: Change workspace row height to 20 pixels.

Submitter:  Dan Sebald <sebald>
Submitted:  Thu 11 Apr 2013 08:00:55 PM UTC
   
 
Category:  None Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  None Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sat 27 Apr 2013 01:37:53 PM UTC, comment #6: 

There is a difference between the row size of a fresh created table and the one after applying resizeRowsToContents () so I guess resizeRowsToContents is not used as default. But you are right, there is still too much wasted space. I therefore pushed your patch with cset http://hg.savannah.gnu.org/hgweb/octave/rev/17941fedd4ce .
Thanks for the patch.

Torsten Lilge <ttl>
Group Member
Fri 26 Apr 2013 10:10:48 PM UTC, comment #5: 

Using resizeRowToContents() is about 20% less height than pre-changeset, but it still has pretty much whitespace.  (One would think that resizeRowToContents() is what is being used by default.  I guess not.)

If that amount of whitespace is alright with others, it's fine by me.  But a little less would be nice.  [I also think that a little too much space is taken up by the editor menu items and icons.  Maybe that isn't the case for a monitor bigger than I have or of higher resolution.]

The spacing within resizeRowToContents can be changed via the delegate size hint:

http://qt-project.org/doc/qt-4.8/qtableview.html#sizeHintForRow

But that would require creating a class that inherits the QTableView.  Not a difficult thing to do.  Probably the proper thing to do.  But ultimately the row height scaling is tied to font height somehow.

Should we look a little further at what the code (link below) is doing?

http://qt.gitorious.org/qt/qt-gberg/blobs/90cdbf8bd409652fd1e28adcd7f02fc1fae2c1c0/src/gui/itemviews/qtableview.cpp#line1474

It looks to me that every column in the row is checked for the height it requires and then I assume the row is chosen as the maximum.  To get the required size, the QItemDelegate is inquired for the given index.  I'm guessing that an item delegate is something that specifies the height of an object without having to render that object.

So, maybe we'd have to go back to the items within the table and change their delegate somehow.

Dan Sebald <sebald>
Fri 26 Apr 2013 08:13:36 PM UTC, comment #4: 

I slighty modified the patch. Using resizeRowToContents (), we do not have to take care of font metrics. What do you think?

(file #27955)

Torsten Lilge <ttl>
Group Member
Fri 12 Apr 2013 08:53:10 AM UTC, comment #3: 

Try the new changeset.  Kind of scrunched together, but I don't mind it.  Can add 10% if users complain.

(file #27852)

Dan Sebald <sebald>
Fri 12 Apr 2013 07:41:23 AM UTC, comment #2: 

Probably is.  I garnered that is what you were aiming for with the resize feature.  But that resize feature must be set up to have a lot of margin.  I'll search around in the Qt documentation if there is some way of adjusting that.  As a last resort there is probably a font model which will provide the height of an 'h' or something.

Dan Sebald <sebald>
Fri 12 Apr 2013 06:02:50 AM UTC, comment #1: 

Is there some way to make the height dependent on the font size?

John W. Eaton <jwe>
Group administrator
Thu 11 Apr 2013 08:00:55 PM UTC, original submission:  

This patch will adjust the appearance of any new rows in the workspace view after a change in the workspace data model.

Dan Sebald <sebald>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by ttl (Updated the item)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by sebald (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-04-27 ttl StatusNone Done
        Open/ClosedOpen Closed
    2013-04-26 ttl Attached File- Added ws_row_height_2013-04-26.diff, #27955
    2013-04-12 sebald Attached File- Added octave-gui_workspace_row_height-2013apr12.patch, #27852
    2013-04-11 sebald Attached File- Added octave-gui_workspace_row_height-2013apr11.patch, #27842

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code