Closed
Bug 451124
Opened 17 years ago
Closed 17 years ago
Fix vertical alignment of context menu submenus
Categories
(Core :: XUL, defect)
Tracking
()
RESOLVED
FIXED
mozilla1.9.1
People
(Reporter: mstange, Assigned: mstange)
Details
Attachments
(2 files, 4 obsolete files)
|
66.65 KB,
image/png
|
Details | |
|
562 bytes,
patch
|
Details | Diff | Splinter Review |
On Mac OS X, native context menus are vertically offset by -4px. We should do the same; it looks better, especially when opening sub menus.
Attachment #334373 -
Flags: review?(mconnor)
Comment 1•17 years ago
|
||
Comment on attachment 334373 [details] [diff] [review]
fix
good catch, thanks!
Attachment #334373 -
Flags: review?(mconnor) → review+
| Assignee | ||
Comment 2•17 years ago
|
||
(The rounded corners in the screenshot are from bug 391984 and should be ignored.)
| Assignee | ||
Comment 4•17 years ago
|
||
Argh... the patch breaks a lot of popup menu mochitests.
I need to fix them before this can land.
Keywords: checkin-needed
| Assignee | ||
Comment 5•17 years ago
|
||
This makes the tests pass.
I've changed the tests to check the popup's margin box instead of its border box. I created two helper functions, getMargins() and getMarginBox(), and put them in popup_shared.js.
The screen position test in test_popup_scaled.xul is now cheating a little (because it needs to know the scale factor in order to pass), but I couldn't find a better way of doing it.
Attachment #334453 -
Flags: review?(enndeakin)
Comment 6•17 years ago
|
||
Huh, if you're trying to change the offset of context menus, why are you changing the top position of all menus?
| Assignee | ||
Comment 7•17 years ago
|
||
Oh... sounds like a good idea. How can I tell context menus from the other menus?
Comment 8•17 years ago
|
||
You would need to change the context menu offset at http://mxr.mozilla.org/mozilla-central/source/layout/xul/base/src/nsMenuPopupFrame.cpp#1000
| Assignee | ||
Comment 9•17 years ago
|
||
Thanks, I've just tested it. However, that doesn't really do what I need here; it only seems to work for top level context menus. I need the offset to apply to sub menus, first and foremost.
And I'd rather have the offset in the CSS, since it's platform and theme-specific.
Comment 10•17 years ago
|
||
OK, so now I'm confused. What do you want this to apply to? Context menus, or submenus?
| Assignee | ||
Comment 11•17 years ago
|
||
Both :)
But submenus are more important: I want the blue bar to look like in the screenshot.
The offset for top level context menus is not really important, but that's what native context menus do.
| Assignee | ||
Comment 12•17 years ago
|
||
Let's do this instead. Are all the combinations of popup and menupopup necessary?
Attachment #334373 -
Attachment is obsolete: true
Attachment #334453 -
Attachment is obsolete: true
Attachment #334804 -
Flags: review?(enndeakin)
Attachment #334453 -
Flags: review?(enndeakin)
Comment 13•17 years ago
|
||
Comment on attachment 334804 [details] [diff] [review]
Only align sub menus
There should be spaces around the >
'popup' is deprecated so I wouldn't bother with those ones, except maybe 'popup menu > menupopup' which is still used in places.
You may want to ask the other Neil as he's more knowledgeable about theme issues.
| Assignee | ||
Comment 14•17 years ago
|
||
Attachment #334804 -
Attachment is obsolete: true
Attachment #334899 -
Flags: review?(neil)
Attachment #334804 -
Flags: review?(enndeakin)
Comment 15•17 years ago
|
||
(In reply to comment #13)
> 'popup' is deprecated so I wouldn't bother with those ones, except maybe 'popup
> menu > menupopup' which is still used in places.
Right, our 131 popups (fx+tb+sm+cr) are all context menus, so they never have menu parents, but I would suggest using child selectors before menu too.
Comment 16•17 years ago
|
||
In fact bug 253661 fixed this for windows, but I notice it also used a -moz-margin-start, presumably to alter the overlap of the submenu.
Interestingly for menus near the bottom of the screen, Windows pops the submenu up (as if it was anchored bottomleft bottomright instead of topleft topright) but we don't seem to do this (I tried in 1.8 and 1.6 too just to be sure).
Comment 17•17 years ago
|
||
Comment on attachment 334899 [details] [diff] [review]
updated patch
r=me if you add in the >s to match winstripe.
Attachment #334899 -
Flags: review?(neil) → review+
| Assignee | ||
Comment 18•17 years ago
|
||
Oops. I would have done that the first time but I had forgotten that XBL-generated elements don't count in the selector.
Attachment #334899 -
Attachment is obsolete: true
Comment 19•17 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.1
Updated•7 years ago
|
Component: XP Toolkit/Widgets: Menus → XUL
You need to log in
before you can comment on or make changes to this bug.
Description
•