--- a/PrintRemover/ConfigurationPage/PrintRemoverPage.py Wed Jan 01 11:59:03 2020 +0100 +++ b/PrintRemover/ConfigurationPage/PrintRemoverPage.py Wed Apr 08 19:33:16 2020 +0200 @@ -14,6 +14,8 @@ from PyQt5.QtCore import pyqtSlot from PyQt5.QtWidgets import QListWidgetItem, QInputDialog, QLineEdit +from E5Gui.E5Application import e5App + from Preferences.ConfigurationPages.ConfigurationPageBase import \ ConfigurationPageBase from .Ui_PrintRemoverPage import Ui_PrintRemoverPage @@ -35,14 +37,28 @@ self.setupUi(self) self.setObjectName("PrintRemoverPage") + try: + usesDarkPalette = e5App().usesDarkPalette() + except AttributeError: + from PyQt5.QtGui import QPalette + palette = e5App().palette() + lightness = palette.color(QPalette.Window).lightness() + usesDarkPalette = lightness <= 128 + if usesDarkPalette: + iconSuffix = "dark" + else: + iconSuffix = "light" + self.editButton.setIcon(UI.PixmapCache.getIcon( - os.path.join("PrintRemover", "icons", "edit.png"))) - self.addButton.setIcon(UI.PixmapCache.getIcon("plus.png")) + os.path.join("PrintRemover", "icons", + "edit-{0}".format(iconSuffix)))) + self.addButton.setIcon(UI.PixmapCache.getIcon("plus")) self.addSeparatorButton.setIcon(UI.PixmapCache.getIcon( - os.path.join("PrintRemover", "icons", "separatorAdd.png"))) - self.deleteButton.setIcon(UI.PixmapCache.getIcon("minus.png")) - self.upButton.setIcon(UI.PixmapCache.getIcon("1uparrow.png")) - self.downButton.setIcon(UI.PixmapCache.getIcon("1downarrow.png")) + os.path.join("PrintRemover", "icons", + "separatorAdd-{0}".format(iconSuffix)))) + self.deleteButton.setIcon(UI.PixmapCache.getIcon("minus")) + self.upButton.setIcon(UI.PixmapCache.getIcon("1uparrow")) + self.downButton.setIcon(UI.PixmapCache.getIcon("1downarrow")) self.editButton.setEnabled(False) self.deleteButton.setEnabled(False)