From 5600fa0c81c5bd77082b2198289cbbbdc1ec3f27 Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Sun, 8 Sep 2024 21:56:49 +0530 Subject: [PATCH] fix(GUI): Fixed unchanged theme of ok button in Confirmation Dialog --- GUI/src/main/java/ui/ConfirmationDialog.java | 4 ++++ GUI/src/main/java/ui/Theme.java | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/GUI/src/main/java/ui/ConfirmationDialog.java b/GUI/src/main/java/ui/ConfirmationDialog.java index 7701058e..4d42b719 100644 --- a/GUI/src/main/java/ui/ConfirmationDialog.java +++ b/GUI/src/main/java/ui/ConfirmationDialog.java @@ -163,6 +163,10 @@ private void showScene() { stage = Constants.getStage(windowTitle, false); scene = Constants.getScene(vbox); Theme.applyTheme(AppSettings.GET.mainTheme(), scene); + boolean isDark = "Dark".equals(AppSettings.GET.mainTheme()); + Theme.changeButtonStyle(isDark, btnYes); + Theme.changeButtonStyle(isDark, btnNo); + Theme.changeButtonStyle(isDark, btnOk); stage.setWidth(width); stage.setHeight(height); stage.setScene(scene); diff --git a/GUI/src/main/java/ui/Theme.java b/GUI/src/main/java/ui/Theme.java index 5212a27d..5b8bd3a3 100644 --- a/GUI/src/main/java/ui/Theme.java +++ b/GUI/src/main/java/ui/Theme.java @@ -87,8 +87,7 @@ private static void updateTextColors(boolean isDark, Scene... scenes) { private static void changeInfoTextFlow(Paint color) { Color headingsColor = "Dark".equals(AppSettings.GET.mainTheme()) ? Color.LIGHTGREEN : Color.DARKBLUE; for (int i = 0; i < UIController.getInfoTf().getChildren().size(); i++) { - if (UIController.getInfoTf().getChildren().get(i) instanceof Text) { - Text text = (Text) UIController.getInfoTf().getChildren().get(i); + if (UIController.getInfoTf().getChildren().get(i) instanceof Text text) { if (text.getFont().getSize() == 16) { ((Text) UIController.getInfoTf().getChildren().get(i)).setFill(color); } else {