Closed Bug 451124 Opened 17 years ago Closed 17 years ago

Fix vertical alignment of context menu submenus

Categories

(Core :: XUL, defect)

All
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.1

People

(Reporter: mstange, Assigned: mstange)

Details

Attachments

(2 files, 4 obsolete files)

Attached patch fix (obsolete) — 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 on attachment 334373 [details] [diff] [review] fix good catch, thanks!
Attachment #334373 - Flags: review?(mconnor) → review+
Attached image screenshot
(The rounded corners in the screenshot are from bug 391984 and should be ignored.)
Wow, that was fast! :)
Keywords: checkin-needed
Argh... the patch breaks a lot of popup menu mochitests. I need to fix them before this can land.
Keywords: checkin-needed
Attached patch fix tests (obsolete) — Splinter Review
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)
Huh, if you're trying to change the offset of context menus, why are you changing the top position of all menus?
Oh... sounds like a good idea. How can I tell context menus from the other menus?
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.
OK, so now I'm confused. What do you want this to apply to? Context menus, or submenus?
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.
Attached patch Only align sub menus (obsolete) — Splinter Review
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 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.
Attached patch updated patch (obsolete) — Splinter Review
Attachment #334804 - Attachment is obsolete: true
Attachment #334899 - Flags: review?(neil)
Attachment #334804 - Flags: review?(enndeakin)
(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.
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 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+
Attached patch Add >sSplinter Review
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
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.1
Component: XP Toolkit/Widgets: Menus → XUL
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: