From 7027f9ca58495e1809571fe94dc48fb9f1857b71 Mon Sep 17 00:00:00 2001 From: Marcel Date: Mon, 11 Sep 2017 16:06:25 +0200 Subject: [PATCH] [update] stylename active used to init combobox --- QtPyLoT.py | 1 + pylot/core/util/widgets.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/QtPyLoT.py b/QtPyLoT.py index 4dac3576..5e39c859 100755 --- a/QtPyLoT.py +++ b/QtPyLoT.py @@ -711,6 +711,7 @@ class MainWindow(QMainWindow): style = self._styles[stylename] self._style = style + self._stylename = stylename self.setStyleSheet(style['stylesheet']) # colors for ref/test event diff --git a/pylot/core/util/widgets.py b/pylot/core/util/widgets.py index b3323fd7..f636ebb0 100644 --- a/pylot/core/util/widgets.py +++ b/pylot/core/util/widgets.py @@ -3738,10 +3738,13 @@ class GraphicsTab(PropTab): def add_style_settings(self): styles = self.pylot_mainwindow._styles + active_stylename = self.pylot_mainwindow._stylename label = QtGui.QLabel('Application style (might require Application restart):') self.style_cb = QComboBox() for stylename, style in styles.items(): self.style_cb.addItem(stylename, style) + index_current_style = self.style_cb.findText(active_stylename) + self.style_cb.setCurrentIndex(index_current_style) self.main_layout.addWidget(label, 2, 0) self.main_layout.addWidget(self.style_cb, 2, 1) self.style_cb.activated.connect(self.set_current_style)