11 |
11 |
12 import os |
12 import os |
13 |
13 |
14 from PyQt5.QtCore import pyqtSlot |
14 from PyQt5.QtCore import pyqtSlot |
15 from PyQt5.QtWidgets import QListWidgetItem, QInputDialog, QLineEdit |
15 from PyQt5.QtWidgets import QListWidgetItem, QInputDialog, QLineEdit |
|
16 |
|
17 from E5Gui.E5Application import e5App |
16 |
18 |
17 from Preferences.ConfigurationPages.ConfigurationPageBase import \ |
19 from Preferences.ConfigurationPages.ConfigurationPageBase import \ |
18 ConfigurationPageBase |
20 ConfigurationPageBase |
19 from .Ui_PrintRemoverPage import Ui_PrintRemoverPage |
21 from .Ui_PrintRemoverPage import Ui_PrintRemoverPage |
20 |
22 |
33 """ |
35 """ |
34 super(PrintRemoverPage, self).__init__() |
36 super(PrintRemoverPage, self).__init__() |
35 self.setupUi(self) |
37 self.setupUi(self) |
36 self.setObjectName("PrintRemoverPage") |
38 self.setObjectName("PrintRemoverPage") |
37 |
39 |
|
40 try: |
|
41 usesDarkPalette = e5App().usesDarkPalette() |
|
42 except AttributeError: |
|
43 from PyQt5.QtGui import QPalette |
|
44 palette = e5App().palette() |
|
45 lightness = palette.color(QPalette.Window).lightness() |
|
46 usesDarkPalette = lightness <= 128 |
|
47 if usesDarkPalette: |
|
48 iconSuffix = "dark" |
|
49 else: |
|
50 iconSuffix = "light" |
|
51 |
38 self.editButton.setIcon(UI.PixmapCache.getIcon( |
52 self.editButton.setIcon(UI.PixmapCache.getIcon( |
39 os.path.join("PrintRemover", "icons", "edit.png"))) |
53 os.path.join("PrintRemover", "icons", |
40 self.addButton.setIcon(UI.PixmapCache.getIcon("plus.png")) |
54 "edit-{0}".format(iconSuffix)))) |
|
55 self.addButton.setIcon(UI.PixmapCache.getIcon("plus")) |
41 self.addSeparatorButton.setIcon(UI.PixmapCache.getIcon( |
56 self.addSeparatorButton.setIcon(UI.PixmapCache.getIcon( |
42 os.path.join("PrintRemover", "icons", "separatorAdd.png"))) |
57 os.path.join("PrintRemover", "icons", |
43 self.deleteButton.setIcon(UI.PixmapCache.getIcon("minus.png")) |
58 "separatorAdd-{0}".format(iconSuffix)))) |
44 self.upButton.setIcon(UI.PixmapCache.getIcon("1uparrow.png")) |
59 self.deleteButton.setIcon(UI.PixmapCache.getIcon("minus")) |
45 self.downButton.setIcon(UI.PixmapCache.getIcon("1downarrow.png")) |
60 self.upButton.setIcon(UI.PixmapCache.getIcon("1uparrow")) |
|
61 self.downButton.setIcon(UI.PixmapCache.getIcon("1downarrow")) |
46 |
62 |
47 self.editButton.setEnabled(False) |
63 self.editButton.setEnabled(False) |
48 self.deleteButton.setEnabled(False) |
64 self.deleteButton.setEnabled(False) |
49 self.upButton.setEnabled(False) |
65 self.upButton.setEnabled(False) |
50 self.downButton.setEnabled(False) |
66 self.downButton.setEnabled(False) |