--- a/eric7/EricWidgets/EricApplication.py Sun Dec 19 19:38:18 2021 +0100 +++ b/eric7/EricWidgets/EricApplication.py Mon Dec 20 14:51:29 2021 +0100 @@ -7,6 +7,8 @@ Class implementing a specialized application class. """ +import os + from PyQt6.QtCore import Qt, QCoreApplication from PyQt6.QtGui import QColor, QPalette from PyQt6.QtWidgets import QApplication @@ -186,6 +188,9 @@ @param filename name of the QSS style sheet file @type str """ + import Preferences + from eric7config import getConfig + if filename: try: with open(filename, "r", encoding="utf-8") as f: @@ -204,6 +209,17 @@ else: styleSheet = "" + if styleSheet: + # preprocess the style sheet to replace the placeholder for the + # path to the icons + styleIconsPath = Preferences.getUI("StyleIconsPath") + if not styleIconsPath: + # default ist the 'StyleIcons' subdirectory of the icons + # directory + styleIconsPath = os.path.join( + getConfig('ericIconDir'), "StyleIcons") + styleSheet = styleSheet.replace("${path}", styleIconsPath) + if "QPalette {" in styleSheet: self.__setPaletteFromStyleSheet(styleSheet)