view patches/openjdk/7169111-pr2757-unreadable_menu_bar_with_ambiance_theme.patch @ 3240:8554f062d23d

Add new backports for issues to be fixed in 1.13.10. S7169111, PR2757: Unreadable menu bar with Ambiance theme in GTK L&F S8140620, PR2711: Find and load default.sf2 as the default soundbank on Linux 2016-01-19 Andrew John Hughes <gnu.andrew@redhat.com> * Makefile.am: (ICEDTEA_PATCHES): Add new patches. * NEWS: Updated. * patches/openjdk/7169111-pr2757-unreadable_menu_bar_with_ambiance_theme.patch, * patches/openjdk/8140620-pr2711-find_default.sf2.patch: New backports for issues to be fixed in 1.13.10.
author Andrew John Hughes <gnu.andrew@redhat.com>
date Thu, 21 Jan 2016 01:22:57 +0000
parents
children
line wrap: on
line source

# HG changeset patch
# User rupashka
# Date 1342090033 -14400
#      Thu Jul 12 14:47:13 2012 +0400
# Node ID 05c69338ee73c1e454aa632ced5cbc057420b404
# Parent  0039f5c7fb512e1ec2e22bceb69ee324426a684f
7169111, PR2757: Unreadable menu bar with Ambiance theme in GTK L&F
Reviewed-by: kizune

diff -r 0039f5c7fb51 -r 05c69338ee73 src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java
--- openjdk/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java	Wed Jul 11 16:19:41 2012 -0700
+++ openjdk/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java	Thu Jul 12 14:47:13 2012 +0400
@@ -796,9 +796,10 @@
             "Menu.margin", zeroInsets,
             "Menu.cancelMode", "hideMenuTree",
             "Menu.alignAcceleratorText", Boolean.FALSE,
+            "Menu.useMenuBarForTopLevelMenus", Boolean.TRUE,
 
 
-            "MenuBar.windowBindings", new Object[] {
+                "MenuBar.windowBindings", new Object[] {
                 "F10", "takeFocus" },
             "MenuBar.font", new FontLazyValue(Region.MENU_BAR),
 
diff -r 0039f5c7fb51 -r 05c69338ee73 src/share/classes/com/sun/java/swing/plaf/gtk/GTKStyleFactory.java
--- openjdk/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKStyleFactory.java	Wed Jul 11 16:19:41 2012 -0700
+++ openjdk/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKStyleFactory.java	Thu Jul 12 14:47:13 2012 +0400
@@ -92,7 +92,13 @@
                 boolean defaultCapable = btn.isDefaultCapable();
                 key = new ComplexKey(wt, toolButton, defaultCapable);
             }
+        } else if (id == Region.MENU) {
+            if (c instanceof JMenu && ((JMenu) c).isTopLevelMenu() &&
+                    UIManager.getBoolean("Menu.useMenuBarForTopLevelMenus")) {
+                wt = WidgetType.MENU_BAR;
+            }
         }
+
         if (key == null) {
             // Otherwise, just use the WidgetType as the key.
             key = wt;
diff -r 0039f5c7fb51 -r 05c69338ee73 src/share/classes/javax/swing/plaf/synth/SynthMenuUI.java
--- openjdk/jdk/src/share/classes/javax/swing/plaf/synth/SynthMenuUI.java	Wed Jul 11 16:19:41 2012 -0700
+++ openjdk/jdk/src/share/classes/javax/swing/plaf/synth/SynthMenuUI.java	Thu Jul 12 14:47:13 2012 +0400
@@ -299,7 +299,8 @@
      */
     @Override
     public void propertyChange(PropertyChangeEvent e) {
-        if (SynthLookAndFeel.shouldUpdateStyle(e)) {
+        if (SynthLookAndFeel.shouldUpdateStyle(e) ||
+                (e.getPropertyName().equals("ancestor") && UIManager.getBoolean("Menu.useMenuBarForTopLevelMenus"))) {
             updateStyle((JMenu)e.getSource());
         }
     }