< prev index next >

src/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -276,11 +276,21 @@
             }
         }
         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;
     }
 
     /**
      * Returns the X thickness to use for this GTKStyle.

@@ -709,33 +719,37 @@
     public boolean isOpaque(SynthContext context) {
         Region region = context.getRegion();
         if (region == Region.COMBO_BOX ||
               region == Region.DESKTOP_PANE ||
               region == Region.DESKTOP_ICON ||
-              region == Region.EDITOR_PANE ||
-              region == Region.FORMATTED_TEXT_FIELD ||
               region == Region.INTERNAL_FRAME ||
               region == Region.LIST ||
               region == Region.MENU_BAR ||
               region == Region.PANEL ||
-              region == Region.PASSWORD_FIELD ||
               region == Region.POPUP_MENU ||
               region == Region.PROGRESS_BAR ||
               region == Region.ROOT_PANE ||
               region == Region.SCROLL_PANE ||
-              region == Region.SPINNER ||
               region == Region.SPLIT_PANE_DIVIDER ||
               region == Region.TABLE ||
               region == Region.TEXT_AREA ||
-              region == Region.TEXT_FIELD ||
-              region == Region.TEXT_PANE ||
               region == Region.TOOL_BAR_DRAG_WINDOW ||
               region == Region.TOOL_TIP ||
               region == Region.TREE ||
               region == Region.VIEWPORT) {
             return true;
         }
+        if (!GTKLookAndFeel.is3()) {
+            if (region == Region.EDITOR_PANE ||
+                  region == Region.FORMATTED_TEXT_FIELD ||
+                  region == Region.PASSWORD_FIELD ||
+                  region == Region.SPINNER ||
+                  region == Region.TEXT_FIELD ||
+                  region == Region.TEXT_PANE) {
+                return true;
+            }
+        }
         Component c = context.getComponent();
         String name = c.getName();
         if (name == "ComboBox.renderer" || name == "ComboBox.listRenderer") {
             return true;
         }

@@ -827,10 +841,18 @@
             int focusSize =
                 getClassSpecificIntValue(context, "focus-line-width", 1);
             int focusPad =
                 getClassSpecificIntValue(context, "focus-padding", 1);
             return indicatorSpacing + focusSize + focusPad;
+        } else if (GTKLookAndFeel.is3() && "ComboBox.forceOpaque".equals(key)) {
+            return true;
+        } else if ("Tree.expanderSize".equals(key)) {
+            Object value = getClassSpecificValue("expander-size");
+            if (value instanceof Integer) {
+                return (Integer)value + 4;
+            }
+            return null;
         }
 
         // Is it a stock icon ?
         GTKStockIcon stockIcon = null;
         synchronized (ICONS_MAP) {

@@ -1106,13 +1128,13 @@
     }
 
     static {
         CLASS_SPECIFIC_MAP = new HashMap<String,String>();
         CLASS_SPECIFIC_MAP.put("Slider.thumbHeight", "slider-width");
+        CLASS_SPECIFIC_MAP.put("Slider.thumbWidth", "slider-length");
         CLASS_SPECIFIC_MAP.put("Slider.trackBorder", "trough-border");
         CLASS_SPECIFIC_MAP.put("SplitPane.size", "handle-size");
-        CLASS_SPECIFIC_MAP.put("Tree.expanderSize", "expander-size");
         CLASS_SPECIFIC_MAP.put("ScrollBar.thumbHeight", "slider-width");
         CLASS_SPECIFIC_MAP.put("ScrollBar.width", "slider-width");
         CLASS_SPECIFIC_MAP.put("TextArea.caretForeground", "cursor-color");
         CLASS_SPECIFIC_MAP.put("TextArea.caretAspectRatio", "cursor-aspect-ratio");
         CLASS_SPECIFIC_MAP.put("TextField.caretForeground", "cursor-color");
< prev index next >