eric6/Toolbox/Startup.py

changeset 7527
b2ae47eaf0ae
parent 7521
17974c348101
child 7528
0345f54d3959
equal deleted inserted replaced
7526:92ef4bd9d2c5 7527:b2ae47eaf0ae
17 from E5Gui.E5Application import E5Application 17 from E5Gui.E5Application import E5Application
18 18
19 import Globals 19 import Globals
20 20
21 import UI.PixmapCache 21 import UI.PixmapCache
22 import Preferences
22 23
23 from eric6config import getConfig 24 from eric6config import getConfig
24 25
25 application = None 26 application = None
26 27
121 @param application reference to the application object 122 @param application reference to the application object
122 @type E5Application 123 @type E5Application
123 """ 124 """
124 import Preferences 125 import Preferences
125 126
126 # TODO: make default icon set configurable 127 defaultIconPaths = getDefaultIconPaths(application)
127 # - automatic (w.r.t. lightness)
128 # - breeze-light
129 # - breeze-dark
130 # - oxygen (formerly default)
131 if application.usesDarkPalette():
132 # dark desktop
133 iconPath = "breeze-dark"
134 else:
135 # light desktop
136 iconPath = "breeze-light"
137 defaultIconPaths = [
138 # add paths for vector graphics
139 os.path.join(getConfig('ericIconDir'), iconPath),
140 os.path.join(getConfig('ericIconDir'), iconPath, "languages"),
141 ]
142 iconPaths = Preferences.getIcons("Path") 128 iconPaths = Preferences.getIcons("Path")
143 for iconPath in iconPaths: 129 for iconPath in iconPaths:
144 if iconPath: 130 if iconPath:
145 UI.PixmapCache.addSearchPath(iconPath) 131 UI.PixmapCache.addSearchPath(iconPath)
146 for defaultIconPath in defaultIconPaths: 132 for defaultIconPath in defaultIconPaths:
147 if defaultIconPath not in iconPaths: 133 if defaultIconPath not in iconPaths:
148 UI.PixmapCache.addSearchPath(defaultIconPath) 134 UI.PixmapCache.addSearchPath(defaultIconPath)
135
136
137 def getDefaultIconPaths(application):
138 """
139 Module function to determine the default icon paths.
140
141 @param application reference to the application object
142 @type E5Application
143 @return list of default icon paths
144 @rtype list of str
145 """
146 defaultIconsPath = Preferences.getIcons("DefaultIconsPath")
147 if defaultIconsPath == "automatic":
148 if application.usesDarkPalette():
149 # dark desktop
150 defaultIconsPath = "breeze-dark"
151 else:
152 # light desktop
153 defaultIconsPath = "breeze-light"
154
155 return [
156 os.path.join(getConfig('ericIconDir'), defaultIconsPath),
157 os.path.join(getConfig('ericIconDir'), defaultIconsPath, "languages"),
158 ]
149 159
150 160
151 def setLibraryPaths(): 161 def setLibraryPaths():
152 """ 162 """
153 Module function to set the Qt library paths correctly for windows systems. 163 Module function to set the Qt library paths correctly for windows systems.

eric ide

mercurial