diff -r bba5648eac76 -r 1f239d5f89b8 eric6/Toolbox/Startup.py --- a/eric6/Toolbox/Startup.py Mon Mar 16 19:24:18 2020 +0100 +++ b/eric6/Toolbox/Startup.py Mon Mar 16 19:25:47 2020 +0100 @@ -12,6 +12,7 @@ import sys from PyQt5.QtCore import QTranslator, QLocale, QLibraryInfo, QDir +from PyQt5.QtGui import QPalette from PyQt5.QtWidgets import QApplication from E5Gui.E5Application import E5Application @@ -114,13 +115,28 @@ return (None, False) -def initializeResourceSearchPath(): +def initializeResourceSearchPath(application): """ Module function to initialize the default mime source factory. + + @param application reference to the application objetc + @type QGuiApplication """ import Preferences + palette = application.palette() + lightness = palette.color(QPalette.Window).lightness() + if lightness > 128: + # light desktop + iconPath = "breeze" + else: + # dark desktop + iconPath = "breeze-dark" defaultIconPaths = [ + # add paths for vector graphics + os.path.join(getConfig('ericIconDir'), iconPath), + os.path.join(getConfig('ericIconDir'), iconPath, "languages"), + # add old default pixel icons os.path.join(getConfig('ericIconDir'), "default"), os.path.join(getConfig('ericIconDir'), "default", "languages"), ] @@ -232,7 +248,7 @@ # the following code depends upon a valid application object import Preferences - initializeResourceSearchPath() + initializeResourceSearchPath(app) QApplication.setWindowIcon(UI.PixmapCache.getIcon("eric.png")) qtTransDir = Preferences.getQtTranslationsDir()