1717import  javafx .scene .control .ToggleButton ;
1818import  javafx .scene .image .Image ;
1919import  javafx .scene .paint .Color ;
20- 
21- import  org .jabref .preferences .JabRefPreferences ;
20+ import  javafx .scene .text .Font ;
2221
2322import  de .jensd .fx .glyphs .GlyphIcons ;
2423import  de .jensd .fx .glyphs .materialdesignicons .MaterialDesignIcon ;
2726
2827public  class  IconTheme  {
2928
30-     public  static  final  Color  DEFAULT_DISABLED_COLOR  = JabRefPreferences . getInstance (). getColor ( JabRefPreferences . ICON_DISABLED_COLOR );
31-     public  static  final  javafx . scene . paint . Color  SELECTED_COLOR  = javafx . scene . paint . Color .web ("#50618F" );
29+     public  static  final  Color  DEFAULT_DISABLED_COLOR  = Color . web ( "#c8c8c8" );
30+     public  static  final  Color  SELECTED_COLOR  = Color .web ("#50618F" );
3231    private  static  final  String  DEFAULT_ICON_PATH  = "/images/external/red.png" ;
3332    private  static  final  Logger  LOGGER  = LoggerFactory .getLogger (IconTheme .class );
34-     private  static  final  Map <String , String > KEY_TO_ICON  = readIconThemeFile (
35-                                                                              IconTheme .class .getResource ("/images/Icons.properties" ), "/images/external/" );
33+     private  static  final  Map <String , String > KEY_TO_ICON  = readIconThemeFile (IconTheme .class .getResource ("/images/Icons.properties" ), "/images/external/" );
3634
3735    public  static  void  loadFonts () {
3836        try  (InputStream  stream  = getMaterialDesignIconsStream ()) {
39-             javafx . scene . text . Font .loadFont (stream , 7 );
37+             Font .loadFont (stream , 7 );
4038        } catch  (IOException  e ) {
4139            LOGGER .error ("Error loading Material Design Icons TTF font" , e );
4240        }
4341
4442        try  (InputStream  stream  = getJabRefMaterialDesignIconsStream ()) {
45-             javafx . scene . text . Font .loadFont (stream , 7 );
43+             Font .loadFont (stream , 7 );
4644        } catch  (IOException  e ) {
4745            LOGGER .error ("Error loading custom font for custom JabRef icons" , e );
4846        }
@@ -86,7 +84,7 @@ public static URL getIconUrl(String name) {
8684        String  key  = Objects .requireNonNull (name , "icon name" );
8785        if  (!KEY_TO_ICON .containsKey (key )) {
8886            LOGGER .warn ("Could not find icon url by name "  + name  + ", so falling back on default icon " 
89-                          + DEFAULT_ICON_PATH );
87+                     + DEFAULT_ICON_PATH );
9088        }
9189        String  path  = KEY_TO_ICON .getOrDefault (key , DEFAULT_ICON_PATH );
9290        return  Objects .requireNonNull (IconTheme .class .getResource (path ), "Path must not be null for key "  + key );
@@ -110,7 +108,7 @@ private static Map<String, String> readIconThemeFile(URL url, String prefix) {
110108        Map <String , String > result  = new  HashMap <>();
111109
112110        try  (BufferedReader  in  = new  BufferedReader (
113-                                                      new  InputStreamReader (url .openStream (), StandardCharsets .ISO_8859_1 ))) {
111+                 new  InputStreamReader (url .openStream (), StandardCharsets .ISO_8859_1 ))) {
114112            String  line ;
115113            while  ((line  = in .readLine ()) != null ) {
116114                if  (!line .contains ("=" )) {
@@ -345,13 +343,11 @@ public ToggleButton asToggleButton() {
345343        @ Override 
346344        public  JabRefIcon  withColor (Color  color ) {
347345            return  icon .withColor (color );
348- 
349346        }
350347
351348        @ Override 
352349        public  JabRefIcon  disabled () {
353350            return  icon .disabled ();
354351        }
355352    }
356- 
357353}
0 commit comments