@@ -417,6 +417,9 @@ public class JabRefPreferences implements PreferencesService {
417
417
// Helper string
418
418
private static final String USER_HOME = System .getProperty ("user.home" );
419
419
420
+ // System default theme / Auto detect theme constant
421
+ private static final String AUTOMATIC_THEME_DETECTION = "automaticThemeDetection" ;
422
+
420
423
// Indexes for Strings within stored custom export entries
421
424
private static final int EXPORTER_NAME_INDEX = 0 ;
422
425
private static final int EXPORTER_FILENAME_INDEX = 1 ;
@@ -787,6 +790,8 @@ private JabRefPreferences() {
787
790
788
791
// set default theme
789
792
defaults .put (FX_THEME , Theme .BASE_CSS );
793
+ // Set automatic theme detection OFF.
794
+ defaults .put (AUTOMATIC_THEME_DETECTION , Boolean .FALSE );
790
795
setLanguageDependentDefaultValues ();
791
796
}
792
797
@@ -2086,7 +2091,8 @@ public WorkspacePreferences getWorkspacePreferences() {
2086
2091
getBoolean (OPEN_LAST_EDITED ),
2087
2092
getBoolean (SHOW_ADVANCED_HINTS ),
2088
2093
getBoolean (WARN_ABOUT_DUPLICATES_IN_INSPECTION ),
2089
- getBoolean (CONFIRM_DELETE ));
2094
+ getBoolean (CONFIRM_DELETE ),
2095
+ getBoolean (AUTOMATIC_THEME_DETECTION ));
2090
2096
2091
2097
EasyBind .listen (workspacePreferences .languageProperty (), (obs , oldValue , newValue ) -> {
2092
2098
put (LANGUAGE , newValue .getId ());
@@ -2102,7 +2108,7 @@ public WorkspacePreferences getWorkspacePreferences() {
2102
2108
EasyBind .listen (workspacePreferences .showAdvancedHintsProperty (), (obs , oldValue , newValue ) -> putBoolean (SHOW_ADVANCED_HINTS , newValue ));
2103
2109
EasyBind .listen (workspacePreferences .warnAboutDuplicatesInInspectionProperty (), (obs , oldValue , newValue ) -> putBoolean (WARN_ABOUT_DUPLICATES_IN_INSPECTION , newValue ));
2104
2110
EasyBind .listen (workspacePreferences .confirmDeleteProperty (), (obs , oldValue , newValue ) -> putBoolean (CONFIRM_DELETE , newValue ));
2105
-
2111
+ EasyBind . listen ( workspacePreferences . automaticThemeDetectionFlag (), ( obs , oldValue , newValue ) -> putBoolean ( AUTOMATIC_THEME_DETECTION , newValue ));
2106
2112
return workspacePreferences ;
2107
2113
}
2108
2114
0 commit comments