示例#1
0
 def __check_icon_theme_compliance(self):
     from python_qt_binding.QtGui import QIcon
     # TODO find a better way to verify Theme standard compliance
     if QIcon.themeName() == '' or \
        QIcon.fromTheme('document-save').isNull() or \
        QIcon.fromTheme('document-open').isNull() or \
        QIcon.fromTheme('edit-cut').isNull() or \
        QIcon.fromTheme('object-flip-horizontal').isNull():
         original_theme = QIcon.themeName()
         QIcon.setThemeName('Tango')
         if QIcon.fromTheme('document-save').isNull():
             QIcon.setThemeName(original_theme)
示例#2
0
文件: main.py 项目: abhat91/ros_osx
 def _check_icon_theme_compliance(self):
     from python_qt_binding.QtGui import QIcon
     # TODO find a better way to verify Theme standard compliance
     if QIcon.themeName() == '' or \
        QIcon.fromTheme('document-save').isNull() or \
        QIcon.fromTheme('document-open').isNull() or \
        QIcon.fromTheme('edit-cut').isNull() or \
        QIcon.fromTheme('object-flip-horizontal').isNull():
         if 'darwin' in platform.platform().lower() and '/usr/local/share/icons' not in QIcon.themeSearchPaths():
             QIcon.setThemeSearchPaths(QIcon.themeSearchPaths() + ['/usr/local/share/icons'])
         original_theme = QIcon.themeName()
         QIcon.setThemeName('Tango')
         if QIcon.fromTheme('document-save').isNull():
             QIcon.setThemeName(original_theme)
示例#3
0
 def _check_icon_theme_compliance(self):
     from python_qt_binding.QtGui import QIcon
     # TODO find a better way to verify Theme standard compliance
     if QIcon.themeName() == '' or \
        QIcon.fromTheme('document-save').isNull() or \
        QIcon.fromTheme('document-open').isNull() or \
        QIcon.fromTheme('edit-cut').isNull() or \
        QIcon.fromTheme('object-flip-horizontal').isNull():
         if 'darwin' in platform.platform().lower() and '/usr/local/share/icons' not in QIcon.themeSearchPaths():
             QIcon.setThemeSearchPaths(QIcon.themeSearchPaths() + ['/usr/local/share/icons'])
         original_theme = QIcon.themeName()
         QIcon.setThemeName('Tango')
         if QIcon.fromTheme('document-save').isNull():
             QIcon.setThemeName(original_theme)
示例#4
0
 def _set_theme_if_necessary(self):
     from python_qt_binding.QtGui import QIcon
     # Always prefer tango_icons_vendor
     package_path = has_resource('packages', 'tango_icons_vendor')
     if package_path:
         icon_paths = QIcon.themeSearchPaths()
         icon_paths = [
             os.path.join(package_path, 'share', 'tango_icons_vendor',
                          'resource', 'icons')
         ] + icon_paths
         QIcon.setThemeSearchPaths(icon_paths)
     # Use Tango if possible, fall back to system default
     original_theme = QIcon.themeName()
     QIcon.setThemeName('Tango')
     if QIcon.fromTheme('document-save').isNull():
         QIcon.setThemeName(original_theme)