1
0
Fork 0
mirror of synced 2024-06-02 02:34:40 +12:00

Make UI default to RareStyle if there are no configuration

This commit is contained in:
Stelios Tsampas 2021-05-19 14:01:21 +03:00
parent 0b5460848d
commit 64712b3eea
2 changed files with 10 additions and 5 deletions

View file

@ -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)

View file

@ -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)