From 668dd884366a652ac2abd7d849d0a6db1edfbce7 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Wed, 9 Dec 2020 08:08:37 +0200 Subject: [PATCH] fix initial theme selection --- src/main/java/com/sparrowwallet/sparrow/AppController.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/AppController.java b/src/main/java/com/sparrowwallet/sparrow/AppController.java index 57c35261..37353a7c 100644 --- a/src/main/java/com/sparrowwallet/sparrow/AppController.java +++ b/src/main/java/com/sparrowwallet/sparrow/AppController.java @@ -1020,8 +1020,10 @@ public class AppController implements Initializable { @Subscribe public void themeChanged(ThemeChangedEvent event) { String darkCss = getClass().getResource("darktheme.css").toExternalForm(); - if(event.getTheme() == Theme.DARK && !tabs.getScene().getStylesheets().contains(darkCss)) { - tabs.getScene().getStylesheets().add(darkCss); + if(event.getTheme() == Theme.DARK) { + if(!tabs.getScene().getStylesheets().contains(darkCss)) { + tabs.getScene().getStylesheets().add(darkCss); + } } else { tabs.getScene().getStylesheets().remove(darkCss); }