changeset 41008:726399082620

8160054: The FileChooser didn't displayed large font with GTK LAF option. Reviewed-by: alexsch, serb
author ssadetsky
date Fri, 09 Sep 2016 16:37:16 +0300
parents d48361243925
children 4ac943a81e95
files 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
diffstat 2 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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;
     }