From fcbd05edecf74a5b0e2f88dce24e6dd6e2135918 Mon Sep 17 00:00:00 2001
From: Omnicscient <115184891+Omnicscient@users.noreply.github.com>
Date: Wed, 17 Dec 2025 21:02:10 +0300
Subject: [PATCH] Add dark mode component overrides, fix sidebar dark mode
styling, update theme toggle to emoji-only
---
.../se302/controller/MainController.java | 4 +-
.../org/example/se302/css/application.css | 189 ++++++++++++++++++
.../org/example/se302/view/main-view.fxml | 4 +-
3 files changed, 193 insertions(+), 4 deletions(-)
diff --git a/src/main/java/org/example/se302/controller/MainController.java b/src/main/java/org/example/se302/controller/MainController.java
index 6c0740b..12c30ab 100644
--- a/src/main/java/org/example/se302/controller/MainController.java
+++ b/src/main/java/org/example/se302/controller/MainController.java
@@ -295,12 +295,12 @@ public class MainController {
if (isDarkMode) {
// Switch to light mode
styleClass.remove("dark");
- themeToggleButton.setText("🌙 Dark Mode");
+ themeToggleButton.setText("🌙");
isDarkMode = false;
} else {
// Switch to dark mode
styleClass.add("dark");
- themeToggleButton.setText("☀️ Light Mode");
+ themeToggleButton.setText("🌞");
isDarkMode = true;
}
}
diff --git a/src/main/resources/org/example/se302/css/application.css b/src/main/resources/org/example/se302/css/application.css
index 9ddb9b1..b6c57c4 100644
--- a/src/main/resources/org/example/se302/css/application.css
+++ b/src/main/resources/org/example/se302/css/application.css
@@ -678,4 +678,193 @@
-fx-font-weight: 500;
-fx-border-color: transparent;
-fx-border-width: 0;
+}
+
+/* ===== Dark Mode Component Overrides ===== */
+
+/* Secondary Button - needs explicit dark colors since palette is inverted */
+.root.dark .secondary-button {
+ -fx-background-color: #475569;
+ -fx-text-fill: #F8FAFC;
+ -fx-border-color: #475569;
+}
+
+.root.dark .secondary-button:hover {
+ -fx-background-color: #64748B;
+ -fx-border-color: #64748B;
+}
+
+/* Regular Button */
+.root.dark .button {
+ -fx-background-color: #334155;
+ -fx-border-color: #475569;
+ -fx-text-fill: #E2E8F0;
+}
+
+.root.dark .button:hover {
+ -fx-background-color: #475569;
+ -fx-border-color: #64748B;
+}
+
+/* Text Fields and Text Areas */
+.root.dark .text-field,
+.root.dark .text-area {
+ -fx-background-color: #1E293B;
+ -fx-border-color: #475569;
+ -fx-text-fill: #F1F5F9;
+ -fx-prompt-text-fill: #64748B;
+}
+
+.root.dark .text-field:focused,
+.root.dark .text-area:focused {
+ -fx-border-color: #6366F1;
+ -fx-background-color: #1E293B;
+}
+
+/* Cards */
+.root.dark .card {
+ -fx-background-color: #1E293B;
+ -fx-border-color: #334155;
+}
+
+/* Tables */
+.root.dark .table-view {
+ -fx-background-color: #1E293B;
+ -fx-border-color: #334155;
+}
+
+.root.dark .table-view .column-header {
+ -fx-background-color: #334155;
+ -fx-text-fill: #CBD5E1;
+}
+
+.root.dark .table-view .column-header-background {
+ -fx-background-color: #334155;
+}
+
+.root.dark .table-view .filler {
+ -fx-background-color: #334155;
+}
+
+.root.dark .table-view .table-cell {
+ -fx-text-fill: #E2E8F0;
+}
+
+.root.dark .table-row-cell {
+ -fx-background-color: #1E293B;
+}
+
+.root.dark .table-row-cell:odd {
+ -fx-background-color: #1a2332;
+}
+
+.root.dark .table-row-cell:selected {
+ -fx-background-color: #312E81;
+}
+
+/* Combo Box */
+.root.dark .combo-box {
+ -fx-background-color: #1E293B;
+ -fx-border-color: #475569;
+}
+
+.root.dark .combo-box .list-cell {
+ -fx-text-fill: #E2E8F0;
+ -fx-background-color: transparent;
+}
+
+.root.dark .combo-box-popup .list-view {
+ -fx-background-color: #1E293B;
+}
+
+.root.dark .combo-box-popup .list-cell {
+ -fx-background-color: #1E293B;
+ -fx-text-fill: #E2E8F0;
+}
+
+.root.dark .combo-box-popup .list-cell:hover {
+ -fx-background-color: #334155;
+}
+
+/* Labels */
+.root.dark .label {
+ -fx-text-fill: #E2E8F0;
+}
+
+.root.dark .description-label {
+ -fx-text-fill: #94A3B8;
+}
+
+.root.dark .status-label {
+ -fx-text-fill: #64748B;
+}
+
+/* Scroll Pane */
+.root.dark .scroll-pane {
+ -fx-background-color: #0F172A;
+}
+
+.root.dark .scroll-pane .viewport {
+ -fx-background-color: #0F172A;
+}
+
+/* Content Pane */
+.root.dark .content-pane {
+ -fx-background-color: #0F172A;
+}
+
+/* Separator */
+.root.dark .separator .line {
+ -fx-border-color: #334155;
+}
+
+/* Status Bar */
+.root.dark .status-bar {
+ -fx-background-color: #1E293B;
+ -fx-border-color: #334155;
+}
+
+/* Header */
+.root.dark .header {
+ -fx-background-color: linear-gradient(to right, #4338CA, #6366F1);
+}
+
+/* Sidebar - ensure same styling in dark mode */
+.root.dark .sidebar-button {
+ -fx-background-color: transparent;
+ -fx-border-color: transparent;
+ -fx-border-width: 0;
+ -fx-text-fill: rgba(255, 255, 255, 0.75);
+}
+
+.root.dark .sidebar-button:hover {
+ -fx-background-color: transparent;
+ -fx-text-fill: white;
+}
+
+.root.dark .sidebar-button:disabled {
+ -fx-text-fill: rgba(255, 255, 255, 0.3);
+}
+
+.root.dark .sidebar-button-active {
+ -fx-background-color: transparent;
+ -fx-text-fill: #5eead4;
+ -fx-border-color: transparent;
+}
+
+.root.dark .sidebar-button-sub {
+ -fx-background-color: transparent;
+ -fx-border-color: transparent;
+ -fx-text-fill: rgba(255, 255, 255, 0.6);
+}
+
+.root.dark .sidebar-button-sub:hover {
+ -fx-background-color: transparent;
+ -fx-text-fill: white;
+}
+
+.root.dark .sidebar-button-sub.sidebar-button-active {
+ -fx-background-color: transparent;
+ -fx-text-fill: #5eead4;
+ -fx-border-color: transparent;
}
\ No newline at end of file
diff --git a/src/main/resources/org/example/se302/view/main-view.fxml b/src/main/resources/org/example/se302/view/main-view.fxml
index eaa14cc..5532c94 100644
--- a/src/main/resources/org/example/se302/view/main-view.fxml
+++ b/src/main/resources/org/example/se302/view/main-view.fxml
@@ -17,8 +17,8 @@
-
+