bugGNUstep - Bugs: bug #35702, NSPopUpButtonCells are clipped too...

Group
 
 

bug #35702: NSPopUpButtonCells are clipped too short

Submitter:  Jonathan Gillaspie <jonathanosx>
Submitted:  Sat 03 Mar 2012 05:33:11 AM UTC
   
 
Category:  Gui/AppKit Severity:  3 - Normal
Item Group:  Bug Status:  Fixed
Privacy:  Public Assigned to:  ericw
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 06 Mar 2012 11:18:54 PM UTC, comment #3: 

Thanks Eric, I tested the fix on our interface and now all of our labels that should fit do.  And the ones that do not aren't being displayed, so I'm happy with the change.

Jonathan Gillaspie <jonathanosx>
Group Member
Tue 06 Mar 2012 08:50:41 AM UTC, comment #2: 

Thanks for the report. From the image it looks like the size of the text is being calculated, used to set the text drawing area, and the rendered text ends up being longer.

I committed r34885 which may help; it won't try to restrict the text drawing area to the calculated size.

If there are still problems, here's a code snippet you can add to the start of the drawTitleForMenuItemCell: method in GSThemeDrawing.m to see the drawing rect that is being calculated.

  // Outline the title rect in red

  [NSGraphicsContext saveGraphicsState];
  [[NSColor redColor] set];
  NSFrameRect([cell titleRectForBounds: cellFrame]);
  [NSGraphicsContext restoreGraphicsState];


Eric Wasylishen <ericw>
Group Member
Tue 06 Mar 2012 02:32:22 AM UTC, comment #1: 

Less pronounced, but this is also a problem on Linux when running Cairo.

(Notice the cropping of the word Cursor and Window).



Jonathan Gillaspie <jonathanosx>
Group Member
Sat 03 Mar 2012 05:33:11 AM UTC, original submission:  

The fix in -r34838 is a welcomed change but it seems to go too far in limiting the drawing on Windows with the WinUXTheme, in some cases not even half of the button width is drawn in.

Please see an attached screen shot of one of our preference panes -- the "Mouse Right Click" button should say "Control" but it only has "Contro".

Revision 34838:

  • Source/NSMenuItemCell.m (-titleRectForBounds:): Keep title rect

inside cell bounds, to prevent drawing text outside of a
NSPopUpButtonCell which has a label that is too long to fit.


Jonathan Gillaspie <jonathanosx>
Group Member

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #25250:  Screen Shot 2012-03-02 at 10.26.12 PM.png added by jonathanosx (32KiB - image/png - "Too little control")

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by ericw (Posted a comment)
  • -email is unavailable- added by jonathanosx (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 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-03-06 jonathanosx Assigned toNone ericw
        Open/ClosedOpen Closed
    2012-03-06 jonathanosx StatusNone Fixed
    2012-03-06 jonathanosx Attached File- Added Screen Shot 2012-03-05 at 7.30.24 PM.png, #25273
        SummaryNSPopUpButtonCells are clipped too short on WinUXTheme NSPopUpButtonCells are clipped too short
    2012-03-03 jonathanosx Attached File- Added Screen Shot 2012-03-02 at 10.26.12 PM.png, #25250

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code