SelectionEncloser/ConfigurationPage/SelectionEncloserPage.py

changeset 39
401d0bab970d
parent 38
f9f7c3af2f18
child 41
e747eb5f3f43
equal deleted inserted replaced
38:f9f7c3af2f18 39:401d0bab970d
11 11
12 import os 12 import os
13 13
14 from PyQt5.QtCore import pyqtSlot, Qt 14 from PyQt5.QtCore import pyqtSlot, Qt
15 from PyQt5.QtWidgets import QTreeWidgetItem, QInputDialog, QLineEdit, QDialog 15 from PyQt5.QtWidgets import QTreeWidgetItem, QInputDialog, QLineEdit, QDialog
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_SelectionEncloserPage import Ui_SelectionEncloserPage 21 from .Ui_SelectionEncloserPage import Ui_SelectionEncloserPage
20 22
33 """ 35 """
34 super(SelectionEncloserPage, self).__init__() 36 super(SelectionEncloserPage, self).__init__()
35 self.setupUi(self) 37 self.setupUi(self)
36 self.setObjectName("SelectionEncloserPage") 38 self.setObjectName("SelectionEncloserPage")
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("SelectionEncloser", "icons", "edit.png"))) 53 os.path.join("SelectionEncloser", "icons",
40 self.addButton.setIcon(UI.PixmapCache.getIcon("plus.png")) 54 "edit-{0}".format(iconSuffix))))
41 self.deleteButton.setIcon(UI.PixmapCache.getIcon("minus.png")) 55 self.addButton.setIcon(UI.PixmapCache.getIcon("plus"))
42 self.upButton.setIcon(UI.PixmapCache.getIcon("1uparrow.png")) 56 self.deleteButton.setIcon(UI.PixmapCache.getIcon("minus"))
43 self.downButton.setIcon(UI.PixmapCache.getIcon("1downarrow.png")) 57 self.upButton.setIcon(UI.PixmapCache.getIcon("1uparrow"))
58 self.downButton.setIcon(UI.PixmapCache.getIcon("1downarrow"))
44 self.addMenuButton.setIcon(UI.PixmapCache.getIcon( 59 self.addMenuButton.setIcon(UI.PixmapCache.getIcon(
45 os.path.join("SelectionEncloser", "icons", "topAdd.png"))) 60 os.path.join("SelectionEncloser", "icons",
61 "topAdd-{0}".format(iconSuffix))))
46 self.addSeparatorButton.setIcon(UI.PixmapCache.getIcon( 62 self.addSeparatorButton.setIcon(UI.PixmapCache.getIcon(
47 os.path.join("SelectionEncloser", "icons", "separatorAdd.png"))) 63 os.path.join("SelectionEncloser", "icons",
64 "separatorAdd-{0}".format(iconSuffix))))
48 65
49 self.editButton.setEnabled(False) 66 self.editButton.setEnabled(False)
50 self.addButton.setEnabled(False) 67 self.addButton.setEnabled(False)
51 self.addSeparatorButton.setEnabled(False) 68 self.addSeparatorButton.setEnabled(False)
52 self.deleteButton.setEnabled(False) 69 self.deleteButton.setEnabled(False)

eric ide

mercurial