mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-84759 (hard-code GTK+ Ambiance menu colors)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2011 JetBrains s.r.o.
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -117,6 +117,11 @@ public final class ActionMenu extends JMenu {
|
||||
public void updateUI() {
|
||||
if (UIUtil.isStandardMenuLAF()) {
|
||||
super.updateUI();
|
||||
|
||||
if (myTopLevel && UIUtil.isUnderGTKLookAndFeel() && "Ambiance".equalsIgnoreCase(UIUtil.getGtkThemeName())) {
|
||||
setForeground(UIUtil.GTK_AMBIANCE_TEXT_COLOR);
|
||||
setBackground(UIUtil.GTK_AMBIANCE_BACKGROUND_COLOR);
|
||||
}
|
||||
}
|
||||
else {
|
||||
setUI(IdeaMenuUI.createUI(this));
|
||||
@@ -131,14 +136,10 @@ public final class ActionMenu extends JMenu {
|
||||
|
||||
@Override
|
||||
public void setUI(final MenuItemUI ui) {
|
||||
final MenuItemUI newUi = !isTopLevel() && UIUtil.isUnderGTKLookAndFeel() && GtkMenuUI.isUiAcceptable(ui) ? new GtkMenuUI(ui) : ui;
|
||||
final MenuItemUI newUi = !myTopLevel && UIUtil.isUnderGTKLookAndFeel() && GtkMenuUI.isUiAcceptable(ui) ? new GtkMenuUI(ui) : ui;
|
||||
super.setUI(newUi);
|
||||
}
|
||||
|
||||
private boolean isTopLevel() {
|
||||
return myTopLevel;
|
||||
}
|
||||
|
||||
private void init() {
|
||||
boolean macSystemMenu = SystemInfo.isMacSystemMenu && myPlace == ActionPlaces.MAIN_MENU;
|
||||
|
||||
|
||||
@@ -828,6 +828,9 @@ public class UIUtil {
|
||||
return UIManager.getLookAndFeel().getName().contains("GTK");
|
||||
}
|
||||
|
||||
public static final Color GTK_AMBIANCE_TEXT_COLOR = new Color(223, 219, 210);
|
||||
public static final Color GTK_AMBIANCE_BACKGROUND_COLOR = new Color(67, 66, 63);
|
||||
|
||||
@SuppressWarnings({"HardCodedStringLiteral"})
|
||||
@Nullable
|
||||
public static String getGtkThemeName() {
|
||||
|
||||
Reference in New Issue
Block a user