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. |