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

 
 

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

Submitted by:  Dan Sebald <sebald>
Submitted on:  Thu 11 Apr 2013 08:00:55 PM UTC  
 
Category: NonePriority: 5 - Normal
Status: DonePrivacy: Public
Assigned to: NoneOpen/Closed: Closed

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission 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 <ttl>
Project 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 <ttl>
Project 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>
Project 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 File(s):
   
   
Comment:
   

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 27 Apr 2013 01:37:53 PM UTCttlStatusNone=>Done
      Open/ClosedOpen=>Closed
    Fri 26 Apr 2013 08:13:36 PM UTCttlAttached File-=>Added ws_row_height_2013-04-26.diff, #27955
    Fri 12 Apr 2013 08:53:10 AM UTCsebaldAttached File-=>Added octave-gui_workspace_row_height-2013apr12.patch, #27852
    Thu 11 Apr 2013 08:00:55 PM UTCsebaldAttached File-=>Added octave-gui_workspace_row_height-2013apr11.patch, #27842

    Back to the top


    Powered by Savane 3.1-cleanup