Removed icons from menu items on Mac OS X

This commit is contained in:
Jonathan Springer 2014-09-04 20:27:21 +02:00 committed by Raoul Snyman
parent cf8f15964c
commit ceeb1b0118
2 changed files with 7 additions and 3 deletions

View File

@ -33,7 +33,7 @@ import logging
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.common import Registry, UiStrings, translate from openlp.core.common import Registry, UiStrings, translate, is_macosx
from openlp.core.lib import build_icon from openlp.core.lib import build_icon
from openlp.core.utils.actions import ActionList from openlp.core.utils.actions import ActionList
@ -247,6 +247,8 @@ def create_action(parent, name, **kwargs):
""" """
action = QtGui.QAction(parent) action = QtGui.QAction(parent)
action.setObjectName(name) action.setObjectName(name)
if is_macosx():
action.setIconVisibleInMenu(False)
if kwargs.get('text'): if kwargs.get('text'):
action.setText(kwargs.pop('text')) action.setText(kwargs.pop('text'))
if kwargs.get('icon'): if kwargs.get('icon'):

View File

@ -118,9 +118,11 @@ class Ui_MainWindow(object):
self.recent_files_menu = QtGui.QMenu(self.file_menu) self.recent_files_menu = QtGui.QMenu(self.file_menu)
self.recent_files_menu.setObjectName('recentFilesMenu') self.recent_files_menu.setObjectName('recentFilesMenu')
self.file_import_menu = QtGui.QMenu(self.file_menu) self.file_import_menu = QtGui.QMenu(self.file_menu)
if not is_macosx():
self.file_import_menu.setIcon(build_icon(u':/general/general_import.png')) self.file_import_menu.setIcon(build_icon(u':/general/general_import.png'))
self.file_import_menu.setObjectName('file_import_menu') self.file_import_menu.setObjectName('file_import_menu')
self.file_export_menu = QtGui.QMenu(self.file_menu) self.file_export_menu = QtGui.QMenu(self.file_menu)
if not is_macosx():
self.file_export_menu.setIcon(build_icon(u':/general/general_export.png')) self.file_export_menu.setIcon(build_icon(u':/general/general_export.png'))
self.file_export_menu.setObjectName('file_export_menu') self.file_export_menu.setObjectName('file_export_menu')
# View Menu # View Menu