From: Maran Date: Thu, 13 Mar 2014 11:02:55 +0000 (+0100) Subject: Changed theme switching, probably fixes #509 as well X-Git-Url: https://git.novaco.in/?p=electrum-nvc.git;a=commitdiff_plain;h=f87e482d637ea0bea822e66fa8ddb8bee59802fb Changed theme switching, probably fixes #509 as well --- diff --git a/data/dark/background.png b/data/dark/background.png deleted file mode 100644 index d106c09..0000000 Binary files a/data/dark/background.png and /dev/null differ diff --git a/data/dark/style.css b/data/dark/style.css index 1c23bb3..c4554e6 100644 --- a/data/dark/style.css +++ b/data/dark/style.css @@ -1,6 +1,6 @@ #main_window { - background-image: url(background.png); + background-image: url(:/icons/dark_background.png); } #address_input[readOnly=true], #amount_input[readOnly=true] diff --git a/gui/qt/lite_window.py b/gui/qt/lite_window.py index 806cdde..29010f1 100644 --- a/gui/qt/lite_window.py +++ b/gui/qt/lite_window.py @@ -348,12 +348,10 @@ class MiniWindow(QDialog): def toggle_theme(self, theme_name): - old_path = QDir.currentPath() self.actuator.change_theme(theme_name) # Recompute style globally qApp.style().unpolish(self) qApp.style().polish(self) - QDir.setCurrent(old_path) def closeEvent(self, event): g = self.geometry() @@ -659,7 +657,6 @@ class MiniActuator: self.g = main_window self.theme_name = self.g.config.get('litegui_theme','Cleanlook') self.themes = load_theme_paths() - # see issue 509 self.load_theme() def load_theme(self): @@ -669,8 +666,8 @@ class MiniActuator: except KeyError: util.print_error("Theme not found!", self.theme_name) return - full_theme_path = ("%s/%s/style.css" % (theme_prefix, theme_path)) - with open(rsrc(full_theme_path)) as style_file: + full_theme_path = "%s/%s/style.css" % (theme_prefix, theme_path) + with open(full_theme_path) as style_file: qApp.setStyleSheet(style_file.read()) def theme_names(self): diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py index be16ab9..c29290e 100644 --- a/gui/qt/main_window.py +++ b/gui/qt/main_window.py @@ -221,19 +221,12 @@ class ElectrumWindow(QMainWindow): actuator = lite_window.MiniActuator(self) - # Should probably not modify the current path but instead - # change the behaviour of rsrc(...) - old_path = QDir.currentPath() actuator.load_theme() self.mini = lite_window.MiniWindow(actuator, self.go_full, self.config) driver = lite_window.MiniDriver(self, self.mini) - # Reset path back to original value now that loading the GUI - # is completed. - QDir.setCurrent(old_path) - if self.config.get('lite_mode') is True: self.go_lite() else: diff --git a/icons.qrc b/icons.qrc index f116a96..9bbbfa6 100644 --- a/icons.qrc +++ b/icons.qrc @@ -21,5 +21,6 @@ icons/electrum_dark_icon.png icons/unconfirmed.png icons/network.png + icons/dark_background.png