qt: again disable changing light/dark theme at runtime
partially reverts 11a04c0d72
related https://github.com/spesmilo/electrum/issues/7209
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user