switch themes without restarting
This commit is contained in:
parent
96d051adfe
commit
428a3b7213
@ -1626,11 +1626,14 @@ class GUI(QtGui.QWidget):
|
||||
self.height = 730
|
||||
self.load_theme()
|
||||
|
||||
def load_theme(self):
|
||||
def load_theme(self, switching=False):
|
||||
theme = get_option("General", "theme", "default")
|
||||
try:
|
||||
with open(AO2XPpath+"ao2xp_themes/"+theme+"/theme.py") as t:
|
||||
exec t
|
||||
if switching:
|
||||
# This is to reset the colors on the music list. Not necessary on startup
|
||||
self.onMusicSearch("")
|
||||
except Exception as e:
|
||||
QtGui.QMessageBox.critical(None, "Unable to load theme", "There was a problem loading the current theme \"%s\":\n\n%s." % (theme, e))
|
||||
os._exit(-2)
|
||||
|
@ -346,7 +346,7 @@ class Settings(QtGui.QDialog):
|
||||
self.gamewindow.gamewidget.text_wait_time = self.textstaytime.value()
|
||||
self.gamewindow.gamewidget.slide_enabled = self.enableslide.isChecked()
|
||||
if not self.theme_state == self.currtheme.currentText():
|
||||
self.gamewindow.gamewidget.load_theme()
|
||||
self.gamewindow.gamewidget.load_theme(True)
|
||||
|
||||
if not self.gamewindow.gamewidget.demo_playing:
|
||||
if not (self.savelogs_state == self.savetolog.isChecked() and self.combinelogs_state == self.savetolog_combine.isChecked()):
|
||||
|
Loading…
Reference in New Issue
Block a user