Open Bug 288322 Opened 19 years ago Updated 2 years ago

Generic impl for Mac's Application menu

Categories

(Core :: Widget: Cocoa, defect, P5)

PowerPC
macOS
defect

Tracking

()

mozilla1.9alpha8

People

(Reporter: jhpedemonte, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [mano:cocoa-retarget])

Coming off of a discussion with Mano on Bug 258277...

We need a more generic way to handle menu items that need to be put in the
Application Menu.  Currently, we have special code in nsMenuBarX.cpp to handle
individual items (About, Preferences, Quit, and now 'Check for Update').

Mano suggested handling this mostly in XUL.  We create a Mac only menu
("MacApplicationMenu"), and add the items we want, in the order we want them. 
Then we #ifdef out the items from their normal locations.  The code in
nsMenuBarX would just need to look for the menu id and generically handle it. 
New items would be added to the XUL menu, without needing to touch nsMenuBarX again.

How does this sound?
(About, Preferences, Quit should remain special cased.)

Neil: can we use the <menu> type attribute for that?

Also, I think we don't want to show this menu on other platforms.
is this also for bug 283791 ?
Yes.
Blocks: 283791
You don't need a whole <menu> for that, a <commandset> would do.
I don't know much about <commandset>, but we would need to have access to the
menu label, so we can add that text to the application menu.  Can that be
specified in a <commandset>?
Yes, we'll probably have something like that:

<commandset id="macAppMenu">
  <command id="..." oncommand="..." label="...">
  ...
</commandset>
No longer blocks: 291192
Blocks: 294316
Blocks: 127704
Assignee: joshmoz → bugs.mano
Whiteboard: [mano:cocoa-retarget]
Priority: -- → P2
Target Milestone: --- → mozilla1.9beta
Assignee: mano → joshmoz
Assignee: joshmoz → nobody
Would this approach be able to deal with dynamically added items?
Component: Widget: Mac → Widget: Cocoa
QA Contact: mac → cocoa
Priority: P2 → P5
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.