提交 a60d90be 编写于 作者: R rupashka

7169111: Unreadable menu bar with Ambiance theme in GTK L&F

Reviewed-by: kizune
上级 2a069fb1
......@@ -796,9 +796,10 @@ public class GTKLookAndFeel extends SynthLookAndFeel {
"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),
......
......@@ -92,7 +92,13 @@ class GTKStyleFactory extends SynthStyleFactory {
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;
......
......@@ -299,7 +299,8 @@ public class SynthMenuUI extends BasicMenuUI
*/
@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());
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册