fix initial theme selection

This commit is contained in:
Craig Raw 2020-12-09 08:08:37 +02:00
parent 76820377ae
commit 668dd88436

View file

@ -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)) {
if(event.getTheme() == Theme.DARK) {
if(!tabs.getScene().getStylesheets().contains(darkCss)) {
tabs.getScene().getStylesheets().add(darkCss);
}
} else {
tabs.getScene().getStylesheets().remove(darkCss);
}