Make UI default to RareStyle if there are no configuration
This commit is contained in:
parent
0b5460848d
commit
64712b3eea
11
rare/app.py
11
rare/app.py
|
@ -68,13 +68,18 @@ class App(QApplication):
|
|||
|
||||
# Style
|
||||
self.setStyle(QStyleFactory.create("Fusion"))
|
||||
if (color := settings.value("color_scheme", None)) is not None:
|
||||
if settings.value("color_scheme", None) is None and settings.value("style_sheet", None) is None:
|
||||
settings.setValue("color_scheme", "")
|
||||
settings.setValue("style_sheet", "RareStyle")
|
||||
if color := settings.value("color_scheme", False):
|
||||
settings.setValue("style_sheet", "")
|
||||
custom_palette = load_color_scheme(os.path.join(style_path, "colors", color + ".scheme"))
|
||||
if custom_palette is not None:
|
||||
self.setPalette(custom_palette)
|
||||
if (style := settings.value("style_sheet", None)) is not None:
|
||||
elif style := settings.value("style_sheet", False):
|
||||
settings.setValue("color_scheme", "")
|
||||
self.setStyleSheet(open(os.path.join(style_path, "qss", style + ".qss")).read())
|
||||
self.setWindowIcon(QIcon(os.path.join(style_path + "Logo.png")))
|
||||
self.setWindowIcon(QIcon(os.path.join(style_path, "Logo.png")))
|
||||
|
||||
# launch app
|
||||
self.launch_dialog = LaunchDialog(self.core, args.offline)
|
||||
|
|
|
@ -110,7 +110,7 @@ class RareSettings(QWidget, Ui_RareSettings):
|
|||
self.style_select.setDisabled(True)
|
||||
self.settings.setValue("color_scheme", self.color_select.currentText())
|
||||
else:
|
||||
self.settings.remove("color_scheme")
|
||||
self.settings.setValue("color_scheme", "")
|
||||
self.style_select.setDisabled(False)
|
||||
self.interface_info.setVisible(True)
|
||||
|
||||
|
@ -120,7 +120,7 @@ class RareSettings(QWidget, Ui_RareSettings):
|
|||
self.color_select.setDisabled(True)
|
||||
self.settings.setValue("style_sheet", self.style_select.currentText())
|
||||
else:
|
||||
self.settings.remove("style_sheet")
|
||||
self.settings.setValue("style_sheet", "")
|
||||
self.color_select.setDisabled(False)
|
||||
self.interface_info.setVisible(True)
|
||||
|
||||
|
|
Loading…
Reference in a new issue