9 |
9 |
10 import glob |
10 import glob |
11 import os |
11 import os |
12 |
12 |
13 from PyQt6.QtCore import pyqtSlot, QTranslator |
13 from PyQt6.QtCore import pyqtSlot, QTranslator |
14 from PyQt6.QtWidgets import QStyleFactory |
14 from PyQt6.QtWidgets import QStyleFactory, QDialog, QColorDialog |
15 |
15 |
16 from EricWidgets.EricPathPicker import EricPathPickerModes |
16 from EricWidgets.EricPathPicker import EricPathPickerModes |
|
17 from EricWidgets.EricIconBar import EricIconBar |
17 |
18 |
18 from .ConfigurationPageBase import ConfigurationPageBase |
19 from .ConfigurationPageBase import ConfigurationPageBase |
19 from .Ui_InterfacePage import Ui_InterfacePage |
20 from .Ui_InterfacePage import Ui_InterfacePage |
20 |
21 |
21 import Preferences |
22 import Preferences |
22 import Utilities |
23 import Utilities |
|
24 import UI.PixmapCache |
23 |
25 |
24 from eric7config import getConfig |
26 from eric7config import getConfig |
25 |
27 |
26 |
28 |
27 class InterfacePage(ConfigurationPageBase, Ui_InterfacePage): |
29 class InterfacePage(ConfigurationPageBase, Ui_InterfacePage): |
39 self.styleSheetPicker.setMode(EricPathPickerModes.OPEN_FILE_MODE) |
41 self.styleSheetPicker.setMode(EricPathPickerModes.OPEN_FILE_MODE) |
40 self.styleSheetPicker.setFilters(self.tr( |
42 self.styleSheetPicker.setFilters(self.tr( |
41 "Qt Style Sheets (*.qss);;Cascading Style Sheets (*.css);;" |
43 "Qt Style Sheets (*.qss);;Cascading Style Sheets (*.css);;" |
42 "All files (*)")) |
44 "All files (*)")) |
43 self.styleSheetPicker.setDefaultDirectory(getConfig("ericStylesDir")) |
45 self.styleSheetPicker.setDefaultDirectory(getConfig("ericStylesDir")) |
|
46 |
|
47 self.sampleLabel.setPixmap( |
|
48 UI.PixmapCache.getPixmap("sbDebugViewer48")) |
|
49 self.highlightedSampleLabel.setPixmap( |
|
50 UI.PixmapCache.getPixmap("sbDebugViewer48")) |
44 |
51 |
45 # set initial values |
52 # set initial values |
46 self.__populateStyleCombo() |
53 self.__populateStyleCombo() |
47 self.__populateLanguageCombo() |
54 self.__populateLanguageCombo() |
48 self.__populateShellPositionCombo() |
55 self.__populateShellPositionCombo() |
96 Preferences.getUI("ShowIrc")) |
103 Preferences.getUI("ShowIrc")) |
97 # bottom side |
104 # bottom side |
98 self.numbersCheckBox.setChecked( |
105 self.numbersCheckBox.setChecked( |
99 Preferences.getUI("ShowNumbersViewer")) |
106 Preferences.getUI("ShowNumbersViewer")) |
100 |
107 |
101 self.delaySpinBox.setValue(Preferences.getUI("SidebarDelay")) |
108 self.__iconBarColor = Preferences.getUI("IconBarColor") |
|
109 self.__setIconBarColorSamples() |
102 |
110 |
103 def save(self): |
111 def save(self): |
104 """ |
112 """ |
105 Public slot to save the Interface configuration. |
113 Public slot to save the Interface configuration. |
106 """ |
114 """ |
272 """ |
280 """ |
273 Private method to reset layout to factory defaults. |
281 Private method to reset layout to factory defaults. |
274 """ |
282 """ |
275 Preferences.resetLayout() |
283 Preferences.resetLayout() |
276 |
284 |
|
285 def __setIconBarColorSamples(self): |
|
286 """ |
|
287 Private method to set the colors of the icon bar color samples. |
|
288 """ |
|
289 self.sampleLabel.setStyleSheet( |
|
290 EricIconBar.LabelStyleSheetTemplate |
|
291 .format(self.__iconBarColor.name())) |
|
292 self.highlightedSampleLabel.setStyleSheet( |
|
293 EricIconBar.LabelStyleSheetTemplate |
|
294 .format(self.__iconBarColor.darker().name())) |
|
295 |
|
296 @pyqtSlot() |
|
297 def on_iconBarButton_clicked(self): |
|
298 """ |
|
299 Private slot to select the icon bar color. |
|
300 """ |
|
301 colDlg = QColorDialog(self) |
|
302 # Set current colour last to avoid conflicts with alpha channel |
|
303 colDlg.setCurrentColor(self.__iconBarColor) |
|
304 if colDlg.exec() == QDialog.DialogCode.Accepted: |
|
305 self.__iconBarColor = colDlg.selectedColor() |
|
306 self.__setIconBarColorSamples() |
|
307 |
277 |
308 |
278 def create(dlg): |
309 def create(dlg): |
279 """ |
310 """ |
280 Module function to create the configuration page. |
311 Module function to create the configuration page. |
281 |
312 |