Browse Source

qt: again disable changing light/dark theme at runtime

partially reverts 11a04c0d72

related https://github.com/spesmilo/electrum/issues/7209
master
SomberNight 4 years ago
parent
commit
7a47eb9906
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
  1. 9
      electrum/gui/qt/__init__.py
  2. 3
      electrum/gui/qt/settings_dialog.py

9
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:

3
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))

Loading…
Cancel
Save