fix menu and separators for darcula

This commit is contained in:
Konstantin Bulenkov
2012-06-21 03:21:05 +02:00
parent b2c5778938
commit a60107a935
3 changed files with 12 additions and 4 deletions
@@ -15,6 +15,8 @@
*/
package com.intellij.ide.ui.laf;
import com.intellij.icons.AllIcons;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.ui.ColorUtil;
@@ -68,6 +70,12 @@ final class IdeaDarkLaf extends BasicLookAndFeel {
final UIDefaults defaults = (UIDefaults)superMethod.invoke(base);
LafManagerImpl.initInputMapDefaults(defaults);
initIdeaDefaults(defaults);
if (SystemInfo.isMac) {
defaults.put("Menu.arrowIcon", AllIcons.Mac.Tree_white_right_arrow);
defaults.put("MenuItem.acceleratorForeground", new ColorUIResource(255, 255, 255));
defaults.put("Separator.foreground", new ColorUIResource(ColorUtil.fromHex("888888")));
defaults.put("PopupMenu.background", new ColorUIResource(ColorUtil.fromHex("444444")));
}
return defaults;
}
catch (Exception ignore) {
@@ -713,7 +713,7 @@ public class ActionToolbarImpl extends JPanel implements ActionToolbar {
protected void paintComponent(final Graphics g) {
final Insets insets = getInsets();
if (UIUtil.isUnderAquaLookAndFeel()) {
if (UIUtil.isUnderAquaBasedLookAndFeel()) {
if (getParent() != null) {
if (myOrientation == SwingConstants.HORIZONTAL) {
UIUtil.drawDoubleSpaceDottedLine((Graphics2D)g, insets.top + 2, getParent().getSize().height - 2 - insets.top - insets.bottom, 3, Color.GRAY, false);
@@ -68,7 +68,7 @@ public class BegMenuItemUI extends BasicMenuItemUI {
public BegMenuItemUI() {
myMaxGutterIconWidth = 18;
if (UIUtil.isUnderAquaLookAndFeel() && myAquaSelectedBackgroundPainter == null) {
if (UIUtil.isUnderAquaBasedLookAndFeel() && myAquaSelectedBackgroundPainter == null) {
myAquaSelectedBackgroundPainter = (Border) UIManager.get("MenuItem.selectedBackgroundPainter");
}
}
@@ -188,10 +188,10 @@ public class BegMenuItemUI extends BasicMenuItemUI {
}
}
}
if (keyStrokeText != null && !keyStrokeText.equals("")){
if (keyStrokeText != null && !keyStrokeText.isEmpty()){
g.setFont(acceleratorFont);
if (buttonmodel.isEnabled()){
if (UIUtil.isUnderAquaLookAndFeel() && (buttonmodel.isArmed() || (comp instanceof JMenu) && buttonmodel.isSelected())) {
if (UIUtil.isUnderAquaBasedLookAndFeel() && (buttonmodel.isArmed() || (comp instanceof JMenu) && buttonmodel.isSelected())) {
g.setColor(selectionForeground);
}
else {