André Sintzoff avatar André Sintzoff committed 15e4386

workbench: don't display icons in menu on Mac OS X

Currently, the function getmenuicon is used for this purpose.
Unfortunately, for actions simultaneously attached to a menu item and to a
toolbar, that function can't be used.

Thanks to qt_mac_set_menubar_icons, the menu icons can always be hidden.
See http://qt-project.org/doc/qt-4.8/exportedfunctions.html

Comments (0)

Files changed (2)

tortoisehg/hgqt/qtlib.py

                             or QIcon(':/icons/fallback.svg'))
         return _iconcache[name]
 
-if sys.platform == 'darwin':
-    # On Mac OS X, we do not want icons on menus
-    def getmenuicon(name):
-        return QIcon()
-else:
-    getmenuicon = geticon
+getmenuicon = geticon
 
 
 def getoverlaidicon(base, overlay):

tortoisehg/hgqt/workbench.py

             self.dockMenu.addAction(_('&Open Repository...'),
                                     self.openRepository)
             qt_mac_set_dock_menu(self.dockMenu)
+            # On Mac OS X, we do not want icons on menus
+            qt_mac_set_menubar_icons(False)
 
         # Create the actions that will be displayed on the context menu
         self.createActions()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.