HiDPI: fix menu items

This commit is contained in:
Konstantin Bulenkov
2015-01-12 23:57:03 +01:00
parent 6eef526ef8
commit b1a37dd7b7
2 changed files with 8 additions and 5 deletions
@@ -557,9 +557,11 @@ public final class LafManagerImpl extends LafManager implements ApplicationCompo
private static void patchHiDPI(UIDefaults defaults) {
if (JBUI.isHiDPI()) {
for (Map.Entry<Object, Object> entry : defaults.entrySet()) {
if (entry.getValue() instanceof DimensionUIResource) {
DimensionUIResource size = (DimensionUIResource)entry.getValue();
entry.setValue(JBUI.size(size).asUIResource());
Object value = entry.getValue();
if (value instanceof DimensionUIResource) {
entry.setValue(JBUI.size((DimensionUIResource)value).asUIResource());
} else if (value instanceof Integer && entry.getKey().toString().endsWith(".maxGutterIconWidth")) {
entry.setValue(Integer.valueOf(JBUI.scale((Integer)value)));
}
}
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2015 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.
@@ -17,6 +17,7 @@ package com.intellij.ui.plaf.beg;
import com.intellij.Patches;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.util.ui.JBUI;
import com.intellij.util.ui.UIUtil;
import javax.swing.*;
@@ -55,7 +56,7 @@ public class IdeaMenuUI extends BasicMenuUI{
}
public IdeaMenuUI() {
myMaxGutterIconWidth = 18;
myMaxGutterIconWidth = JBUI.scale(18);
if (UIUtil.isUnderAquaLookAndFeel()) {
if (myAquaSelectedBackgroundPainter == null) myAquaSelectedBackgroundPainter = (Border) UIManager.get("MenuItem.selectedBackgroundPainter");