Changed theme switching, probably fixes #509 as well
This commit is contained in:
parent
bc1deaa6ba
commit
f87e482d63
Binary file not shown.
Before Width: | Height: | Size: 27 KiB |
|
@ -1,6 +1,6 @@
|
||||||
#main_window
|
#main_window
|
||||||
{
|
{
|
||||||
background-image: url(background.png);
|
background-image: url(:/icons/dark_background.png);
|
||||||
}
|
}
|
||||||
|
|
||||||
#address_input[readOnly=true], #amount_input[readOnly=true]
|
#address_input[readOnly=true], #amount_input[readOnly=true]
|
||||||
|
|
|
@ -348,12 +348,10 @@ class MiniWindow(QDialog):
|
||||||
|
|
||||||
|
|
||||||
def toggle_theme(self, theme_name):
|
def toggle_theme(self, theme_name):
|
||||||
old_path = QDir.currentPath()
|
|
||||||
self.actuator.change_theme(theme_name)
|
self.actuator.change_theme(theme_name)
|
||||||
# Recompute style globally
|
# Recompute style globally
|
||||||
qApp.style().unpolish(self)
|
qApp.style().unpolish(self)
|
||||||
qApp.style().polish(self)
|
qApp.style().polish(self)
|
||||||
QDir.setCurrent(old_path)
|
|
||||||
|
|
||||||
def closeEvent(self, event):
|
def closeEvent(self, event):
|
||||||
g = self.geometry()
|
g = self.geometry()
|
||||||
|
@ -659,7 +657,6 @@ class MiniActuator:
|
||||||
self.g = main_window
|
self.g = main_window
|
||||||
self.theme_name = self.g.config.get('litegui_theme','Cleanlook')
|
self.theme_name = self.g.config.get('litegui_theme','Cleanlook')
|
||||||
self.themes = load_theme_paths()
|
self.themes = load_theme_paths()
|
||||||
# see issue 509
|
|
||||||
self.load_theme()
|
self.load_theme()
|
||||||
|
|
||||||
def load_theme(self):
|
def load_theme(self):
|
||||||
|
@ -669,8 +666,8 @@ class MiniActuator:
|
||||||
except KeyError:
|
except KeyError:
|
||||||
util.print_error("Theme not found!", self.theme_name)
|
util.print_error("Theme not found!", self.theme_name)
|
||||||
return
|
return
|
||||||
full_theme_path = ("%s/%s/style.css" % (theme_prefix, theme_path))
|
full_theme_path = "%s/%s/style.css" % (theme_prefix, theme_path)
|
||||||
with open(rsrc(full_theme_path)) as style_file:
|
with open(full_theme_path) as style_file:
|
||||||
qApp.setStyleSheet(style_file.read())
|
qApp.setStyleSheet(style_file.read())
|
||||||
|
|
||||||
def theme_names(self):
|
def theme_names(self):
|
||||||
|
|
|
@ -221,19 +221,12 @@ class ElectrumWindow(QMainWindow):
|
||||||
|
|
||||||
actuator = lite_window.MiniActuator(self)
|
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()
|
actuator.load_theme()
|
||||||
|
|
||||||
self.mini = lite_window.MiniWindow(actuator, self.go_full, self.config)
|
self.mini = lite_window.MiniWindow(actuator, self.go_full, self.config)
|
||||||
|
|
||||||
driver = lite_window.MiniDriver(self, self.mini)
|
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:
|
if self.config.get('lite_mode') is True:
|
||||||
self.go_lite()
|
self.go_lite()
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -21,5 +21,6 @@
|
||||||
<file>icons/electrum_dark_icon.png</file>
|
<file>icons/electrum_dark_icon.png</file>
|
||||||
<file>icons/unconfirmed.png</file>
|
<file>icons/unconfirmed.png</file>
|
||||||
<file>icons/network.png</file>
|
<file>icons/network.png</file>
|
||||||
|
<file>icons/dark_background.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|
Loading…
Reference in New Issue