Skip to content

Commit 075566b

Browse files
Improve dark mode support for Apple dialog styling
Added explicit handling for dark mode in ModelDetailController by assigning a 'dark' style class when appropriate. Updated CSS to support both .root.dark and direct .dark class for Apple dialog, refined background and border colors, and enhanced shadow effects for better visual separation in dark mode. Also removed unused Cupertino theme imports from MainController.
1 parent b8f7f14 commit 075566b

3 files changed

Lines changed: 15 additions & 6 deletions

File tree

src/main/java/com/org/ollamafx/controller/MainController.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
import java.io.IOException;
1515
import java.net.URL;
1616
import java.util.ResourceBundle;
17-
import atlantafx.base.theme.CupertinoDark;
18-
import atlantafx.base.theme.CupertinoLight;
1917
import javafx.application.Application;
2018
import javafx.animation.FadeTransition;
2119
import javafx.animation.Timeline;

src/main/java/com/org/ollamafx/controller/ModelDetailController.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ private void showDownloadPopup(OllamaModel model) {
7070
String userAgentStylesheet = Application.getUserAgentStylesheet();
7171
if (userAgentStylesheet != null && userAgentStylesheet.toLowerCase().contains("light")) {
7272
root.getStyleClass().add("light");
73+
} else {
74+
// If not explicitly light, assume dark (or check for dark)
75+
// This ensures .root.dark selectors work inside the popup
76+
root.getStyleClass().add("dark");
7377
}
7478

7579
Stage stage = new Stage();

src/main/resources/css/ollama_active.css

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,8 @@
801801

802802
/* --- APPLE DIALOG REDESIGN --- */
803803
.apple-dialog {
804-
-fx-background-color: -color-bg-default;
804+
-fx-background-color: #ffffff;
805+
/* Explicit White for Light Mode to float above grey */
805806
-fx-background-radius: 20px;
806807
-fx-border-radius: 20px;
807808
-fx-border-color: rgba(0, 0, 0, 0.1);
@@ -813,9 +814,15 @@
813814
-fx-alignment: CENTER;
814815
}
815816

816-
.root.dark .apple-dialog {
817-
-fx-border-color: rgba(255, 255, 255, 0.1);
818-
-fx-effect: dropshadow(gaussian, rgba(0, 0, 0, 0.5), 50, 0, 0, 15);
817+
/* Support both .root.dark nesting and direct .dark class on the dialog root */
818+
.root.dark .apple-dialog,
819+
.apple-dialog.dark {
820+
-fx-background-color: #2c2c2e;
821+
/* Secondary System Fill (Lighter than background) */
822+
-fx-border-color: rgba(255, 255, 255, 0.15);
823+
/* More visible border */
824+
-fx-effect: dropshadow(gaussian, rgba(0, 0, 0, 0.8), 60, 0, 0, 20);
825+
/* Stronger shadow for separation */
819826
}
820827

821828
.apple-dialog-title {

0 commit comments

Comments
 (0)