diff --git a/NUSGet.py b/NUSGet.py index 06e7170..afed5e8 100644 --- a/NUSGet.py +++ b/NUSGet.py @@ -130,8 +130,13 @@ class MainWindow(QMainWindow, Ui_MainWindow): self.ui.menuHelp.setWindowFlags(self.ui.menuHelp.windowFlags() | Qt.FramelessWindowHint) self.ui.menuHelp.setWindowFlags(self.ui.menuHelp.windowFlags() | Qt.NoDropShadowWindowHint) self.ui.menuHelp.setAttribute(Qt.WA_TranslucentBackground) - # Load the custom information icon. - icon = QIcon(os.path.join(os.path.dirname(__file__), "resources", "information.svg")) + # Save some light/dark theme values for later, including the appropriately colored info icon. + if is_dark_theme(): + bg_color = "#2b2b2b" + icon = QIcon(os.path.join(os.path.dirname(__file__), "resources", "information_white.svg")) + else: + bg_color = "#e3e3e3" + icon = QIcon(os.path.join(os.path.dirname(__file__), "resources", "information_black.svg")) self.ui.actionAbout.setIcon(icon) self.ui.actionAbout_Qt.setIcon(icon) # Title tree loading code. Now powered by Models:tm: @@ -155,10 +160,6 @@ class MainWindow(QMainWindow, Ui_MainWindow): self.trees[tree].collapsed.connect(lambda: self.resize_tree(self.ui.platform_tabs.currentIndex())) # This stylesheet patch allows me to add the correct padding above the scrollbar so that it doesn't overlap # the QTreeView's header. - if is_dark_theme(): - bg_color = "#2b2b2b" - else: - bg_color = "#e3e3e3" self.trees[tree].setStyleSheet(self.trees[tree].styleSheet() + f""" QTreeView QScrollBar::sub-line:vertical {{ border: 0; diff --git a/qt/py/ui_AboutDialog.py b/qt/py/ui_AboutDialog.py index 8b1bb01..679213b 100644 --- a/qt/py/ui_AboutDialog.py +++ b/qt/py/ui_AboutDialog.py @@ -17,28 +17,6 @@ class AboutNUSGet(QDialog): self.setFixedWidth(450) self.setFixedHeight(500) - # Set background color to match main app - self.setStyleSheet(""" - QLabel[class="title"] { - font-size: 20px; - font-weight: bold; - } - QLabel[class="version"] { - font-size: 13px; - color: #aaaaaa; - } - QLabel[class="copyright"] { - font-size: 12px; - color: #888888; - } - QLabel[class="header"] { - font-size: 14px; - font-weight: bold; - border-bottom: 1px solid #444444; - padding-bottom: 4px; - margin-top: 8px; - }""") - # Create main layout self.layout = QVBoxLayout() self.layout.setSpacing(4) diff --git a/resources/information_black.svg b/resources/information_black.svg new file mode 100644 index 0000000..4a3b2ef --- /dev/null +++ b/resources/information_black.svg @@ -0,0 +1,46 @@ + + + + + + + + + + diff --git a/resources/information.svg b/resources/information_white.svg similarity index 100% rename from resources/information.svg rename to resources/information_white.svg diff --git a/resources/style_dark.qss b/resources/style_dark.qss index 897ed36..da8c99f 100644 --- a/resources/style_dark.qss +++ b/resources/style_dark.qss @@ -10,6 +10,33 @@ QMainWindow QLabel { color: #ffffff; } +QDialog QLabel { + color: #ffffff; +} + +QDialog QLabel[class="title"] { + font-size: 20px; + font-weight: bold; +} + +QDialog QLabel[class="version"] { + font-size: 13px; + color: #aaaaaa; +} + +QDialog QLabel[class="copyright"] { + font-size: 12px; + color: #888888; +} + +QDialog QLabel[class="header"] { + font-size: 14px; + font-weight: bold; + border-bottom: 1px solid #444444; + padding-bottom: 4px; + margin-top: 8px; +} + QMenuBar { background-color: #2b2b2b; } diff --git a/resources/style_light.qss b/resources/style_light.qss index d333062..a1dcaf5 100644 --- a/resources/style_light.qss +++ b/resources/style_light.qss @@ -10,18 +10,46 @@ QMainWindow QLabel { color: #000000; } +QDialog QLabel { + color: #000000; +} + +QDialog QLabel[class="title"] { + font-size: 20px; + font-weight: bold; +} + +QDialog QLabel[class="version"] { + font-size: 13px; + color: #777777; +} + +QDialog QLabel[class="copyright"] { + font-size: 12px; + color: #444444; +} + +QDialog QLabel[class="header"] { + font-size: 14px; + font-weight: bold; + border-bottom: 1px solid #111111; + padding-bottom: 4px; + margin-top: 8px; +} + QMenuBar { - background-color: #ffffff; + background-color: #e3e3e3; + color: #000000; } QMenuBar::item:selected { - background-color: rgba(60, 60, 60, 1); - color: white; + background-color: rgb(195, 195, 195); + color: #000000; } QMenuBar::item:pressed { background-color: #1a73e8; - color: #000000; + color: #ffffff; } QMenu { @@ -42,7 +70,7 @@ QMenu::item { QMenu::item:selected { background-color: #1a73e8; - color: #000000; + color: #ffffff; } QMenu::icon { @@ -107,7 +135,7 @@ QLineEdit:focus { QLineEdit:disabled { background-color: rgba(182, 182, 182, 0.5); border: 1px solid rgba(100, 100, 100, 0.3); - color: rgba(255, 255, 255, 0.3); + color: rgba(143, 143, 143, 0.3); } QTabWidget::pane {