Menu customization: Difference between revisions
(overhaul) |
|||
Line 1: | Line 1: | ||
There are three ways to tweak menus of your XUL-based application, like Mozilla Suite, Thunderbird or Firefox. | |||
==Menu Editor Extension== | |||
If you use Firefox or Thunderbird, you can install [http://menueditor.mozdev.org/ Menu Editor] extension, which allows you hide the menu items as well as reorder them. | |||
Post your feedback in [http://forums.mozillazine.org/viewtopic.php?t=211920 Menu Editor discussion thread] on MozillaZine forums. | |||
==Tweaking userChrome.css== | |||
If you don't want to install Menu Editor, you can tweak your menus using [[userChrome.css]]. First locate your [[profile folder]]. There's a subfolder called "chrome". What you need to do is edit the "userChrome.css" file (create it if it does not exists). | |||
===Using ID selectors=== | |||
Add a line like this to hide any menu item: | |||
#id1, #id2 { display:none !important; } | #id1, #id2 { display:none !important; } | ||
replacing each of the identifiers #id1, #id2, ... with one of the | replacing each of the identifiers #id1, #id2, ... with one of the selectors from [[UserChrome.css Element Names/IDs#Firefox menus]]. | ||
Example (hides the "View Background" menu item and the horizontal line after it): | Example (hides the "View Background" menu item and the horizontal line after it): | ||
Line 164: | Line 20: | ||
} | } | ||
==Using | ===Using attribute selectors=== | ||
Another way to change the style of a menu item is to use the '''label''' attribute selector. | |||
For example, if you want to hide the "Close Tab" menu item on the tab context menu: | For example, if you want to hide the "Close Tab" menu item on the tab bar context menu: | ||
menuitem[label="Close Tab"] { | menuitem[label="Close Tab"] { | ||
display: none !important; | display: none !important; | ||
Line 176: | Line 32: | ||
text-decoration: line-through !important; | text-decoration: line-through !important; | ||
} | } | ||
==Hacking program files== | |||
TBD. |
Revision as of 12:42, 7 April 2005
There are three ways to tweak menus of your XUL-based application, like Mozilla Suite, Thunderbird or Firefox.
Menu Editor Extension
If you use Firefox or Thunderbird, you can install Menu Editor extension, which allows you hide the menu items as well as reorder them.
Post your feedback in Menu Editor discussion thread on MozillaZine forums.
Tweaking userChrome.css
If you don't want to install Menu Editor, you can tweak your menus using userChrome.css. First locate your profile folder. There's a subfolder called "chrome". What you need to do is edit the "userChrome.css" file (create it if it does not exists).
Using ID selectors
Add a line like this to hide any menu item:
#id1, #id2 { display:none !important; }
replacing each of the identifiers #id1, #id2, ... with one of the selectors from UserChrome.css Element Names/IDs#Firefox menus.
Example (hides the "View Background" menu item and the horizontal line after it):
#context-viewbgimage, #context-sep-viewbgimage { display: none !important; }
Using attribute selectors
Another way to change the style of a menu item is to use the label attribute selector.
For example, if you want to hide the "Close Tab" menu item on the tab bar context menu:
menuitem[label="Close Tab"] { display: none !important; }
or if you want to change the "For Internet Explorer Users" appearance on the "Help" menu:
menuitem[label="For Internet Explorer Users"] { text-decoration: line-through !important; }
Hacking program files
TBD.