Closed
Bug 459729
Opened 17 years ago
Closed 16 years ago
CreateTruncatedCocoaLabel function in MenuHelpersX not available in 64-bit
Categories
(Core :: Widget: Cocoa, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: hiller.moz, Assigned: jaas)
References
Details
Attachments
(1 file)
6.24 KB,
patch
|
mstange
:
review+
roc
:
superreview+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.16) Gecko/20080716 Firefox/2.0.0.16
Build Identifier:
MenuHelpersX::CreateTruncatedCocoaLabel (in widget/src/cocoa/nsMenuX.mm) will truncate the label text of menus and menuitems if they are above a certain length. They do this via the TruncateThemeText carbon call (deprecated as of OS X 10.5). Apart from being deprecated, it appears that this call is unnecessary.
In a xulrunner build I have locally -- the actual app has some menu items with fairly long names, especially in some locales -- I've commented out the call to ::TruncateThemeText and cranked the resolution down to see what happens. It seems that Cocoa is smart enough to shorten menuitem labels and menu labels automatically -- via an ellipsis at the end of the label or mid-label -- if working with a screen resolution too small to fit everything in appropriately. No explicit calls to ::TruncateThemeText are necessary, and in fact, for me, they're harmful.
So it seems like CreateTruncatedCocoaLabel could be eliminated and calls made to it replaced with a call that converts the nsString label to an NSString* directly. I don't know enough about upstream dev practices to suggest a patch myself, though.
Thanks!
Reproducible: Always
Steps to Reproduce:
Create an application menu or menuitem with an unusually long label (> 300 pixels required to render)
Actual Results:
The label is abbreviated with an ellipsis mid-label or at the end of the label, invariably
Expected Results:
The label should be abbreviated with an ellipsis only if necessary, per screen resolution and menu geometry
My build machine is running OS 10.4. Whoever looks at this bug should probably confirm the behavior is the same in OS 10.5.
We need to take care of this for 64-bit.
If I remove truncation of menu item labels I don't see them getting truncated for us. We get some really long menu items, try bookmarking a page with a long title.
We might be able to use "NSLineBreakByTruncatingMiddle" and NSMenuItem's "setAttributedTitle:" as a replacement for "TruncateThemeText".
Summary: CreateTruncatedCocoaLabel function in MenuHelpersX uses deprecated API, perhaps obsolete → CreateTruncatedCocoaLabel function in MenuHelpersX not available in 64-bit
Turn off truncation for now, will file a new bug on adding that to 64-bit in the future. There is no good API for it on 64-bit that I know of.
Also fix up some memory mgmt stuff related to that function.
Attachment #374923 -
Flags: review?(mstange)
Updated•16 years ago
|
Attachment #374923 -
Flags: review?(mstange) → review+
Attachment #374923 -
Flags: superreview?(roc)
Attachment #374923 -
Flags: superreview?(roc) → superreview+
pushed to mozilla-central
http://hg.mozilla.org/mozilla-central/rev/3c1c49cf3fde
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•