diff --git a/electrum/gui/qt/__init__.py b/electrum/gui/qt/__init__.py index 647417f88..05e89d4d7 100644 --- a/electrum/gui/qt/__init__.py +++ b/electrum/gui/qt/__init__.py @@ -147,6 +147,15 @@ class ElectrumGui(BaseElectrumGui, Logger): self.tray.show() def reload_app_stylesheet(self): + """Set the Qt stylesheet and custom colors according to the user-selected + light/dark theme. + TODO this can ~almost be used to change the theme at runtime (without app restart), + except for util.ColorScheme... widgets already created with colors set using + ColorSchemeItem.as_stylesheet() and similar will not get recolored. + See e.g. + - in Coins tab, the color for "frozen" UTXOs, or + - in TxDialog, the receiving/change address colors + """ use_dark_theme = self.config.get('qt_gui_color_theme', 'default') == 'dark' if use_dark_theme: try: diff --git a/electrum/gui/qt/settings_dialog.py b/electrum/gui/qt/settings_dialog.py index 82ad5f406..e451fe6d1 100644 --- a/electrum/gui/qt/settings_dialog.py +++ b/electrum/gui/qt/settings_dialog.py @@ -259,7 +259,8 @@ class SettingsDialog(WindowModalDialog): colortheme_label = QLabel(_('Color theme') + ':') def on_colortheme(x): self.config.set_key('qt_gui_color_theme', colortheme_combo.itemData(x), True) - self.window.gui_object.reload_app_stylesheet() + #self.window.gui_object.reload_app_stylesheet() + self.need_restart = True colortheme_combo.currentIndexChanged.connect(on_colortheme) gui_widgets.append((colortheme_label, colortheme_combo))