8160054: The FileChooser didn't displayed large font with GTK LAF option.
authorssadetsky
Fri, 09 Sep 2016 16:37:16 +0300
changeset 41008 726399082620
parent 41007 d48361243925
child 41009 4ac943a81e95
8160054: The FileChooser didn't displayed large font with GTK LAF option. Reviewed-by: alexsch, serb
jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java
jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java
--- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java	Fri Sep 09 13:15:10 2016 +0530
+++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java	Fri Sep 09 16:37:16 2016 +0300
@@ -504,7 +504,7 @@
             public Object createValue(UIDefaults table) {
                 GTKStyleFactory factory = (GTKStyleFactory)getStyleFactory();
                 GTKStyle style = (GTKStyle)factory.getStyle(null, region);
-                return style.getFontForState(null);
+                return style.getDefaultFont();
             }
         }
 
--- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java	Fri Sep 09 13:15:10 2016 +0530
+++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java	Fri Sep 09 16:37:16 2016 +0300
@@ -282,7 +282,17 @@
         return getColorForState(context, type);
     }
 
+    Font getDefaultFont() {
+        return font;
+    }
+
     protected Font getFontForState(SynthContext context) {
+        Font propFont = UIManager
+                              .getFont(context.getRegion().getName() + ".font");
+        if (propFont != null) {
+            // if font property got a value then return it
+            return propFont;
+        }
         return font;
     }