Skip to content

Commit

Permalink
fix(GUI): Fixed unchanged theme of ok button in Confirmation Dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
SaptarshiSarkar12 committed Sep 8, 2024
1 parent e9c7e0e commit 5600fa0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 4 additions & 0 deletions GUI/src/main/java/ui/ConfirmationDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions GUI/src/main/java/ui/Theme.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 5600fa0

Please sign in to comment.