10 |
10 |
11 import os |
11 import os |
12 import sys |
12 import sys |
13 |
13 |
14 from PyQt5.QtCore import QTranslator, QLocale, QLibraryInfo, QDir |
14 from PyQt5.QtCore import QTranslator, QLocale, QLibraryInfo, QDir |
15 from PyQt5.QtGui import QPalette |
|
16 from PyQt5.QtWidgets import QApplication |
15 from PyQt5.QtWidgets import QApplication |
17 |
16 |
18 from E5Gui.E5Application import E5Application |
17 from E5Gui.E5Application import E5Application |
19 |
18 |
20 import Globals |
19 import Globals |
117 |
116 |
118 def initializeResourceSearchPath(application): |
117 def initializeResourceSearchPath(application): |
119 """ |
118 """ |
120 Module function to initialize the default mime source factory. |
119 Module function to initialize the default mime source factory. |
121 |
120 |
122 @param application reference to the application objetc |
121 @param application reference to the application object |
123 @type QGuiApplication |
122 @type E5Application |
124 """ |
123 """ |
125 import Preferences |
124 import Preferences |
126 |
125 |
127 palette = application.palette() |
126 if application.usesDarkPalette(): |
128 lightness = palette.color(QPalette.Window).lightness() |
127 # dark desktop |
129 if lightness > 128: |
128 iconPath = "breeze-dark" |
|
129 else: |
130 # light desktop |
130 # light desktop |
131 iconPath = "breeze" |
131 iconPath = "breeze" |
132 else: |
|
133 # dark desktop |
|
134 iconPath = "breeze-dark" |
|
135 defaultIconPaths = [ |
132 defaultIconPaths = [ |
136 # add paths for vector graphics |
133 # add paths for vector graphics |
137 os.path.join(getConfig('ericIconDir'), iconPath), |
134 os.path.join(getConfig('ericIconDir'), iconPath), |
138 os.path.join(getConfig('ericIconDir'), iconPath, "languages"), |
135 os.path.join(getConfig('ericIconDir'), iconPath, "languages"), |
139 # add old default pixel icons |
136 # add old default pixel icons |