bugfix: reset path after switching to new theme selection.
This commit is contained in:
@@ -231,10 +231,12 @@ class MiniWindow(QDialog):
|
|||||||
self.show()
|
self.show()
|
||||||
|
|
||||||
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):
|
||||||
super(MiniWindow, self).closeEvent(event)
|
super(MiniWindow, self).closeEvent(event)
|
||||||
@@ -491,9 +493,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
|
||||||
theme_css = os.path.join(theme_path, "style.css")
|
QDir.setCurrent(os.path.join(theme_prefix, theme_path))
|
||||||
QDir.setCurrent(theme_prefix)
|
with open(rsrc("style.css")) as style_file:
|
||||||
with open(rsrc(theme_css)) as style_file:
|
|
||||||
qApp.setStyleSheet(style_file.read())
|
qApp.setStyleSheet(style_file.read())
|
||||||
|
|
||||||
def theme_names(self):
|
def theme_names(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user