[followup] IDEA-162563 Action menus do not have icons under HiDPI linux

- New interface: JBUI.JBIcon. EmptyIcon now implements it.
- New method: JBUI.scale(JBIcon)
This commit is contained in:
Anton Tarasov
2016-10-20 16:12:56 +03:00
parent dd830f4adf
commit b0737a9f3a
54 changed files with 243 additions and 127 deletions
@@ -22,7 +22,7 @@ public class ImportStaticLookupActionProvider implements LookupActionProvider {
}
final Icon checkIcon = PlatformIcons.CHECK_ICON;
final Icon icon = item.willBeImported() ? checkIcon : new EmptyIcon(checkIcon.getIconWidth(), checkIcon.getIconHeight());
final Icon icon = item.willBeImported() ? checkIcon : EmptyIcon.create(checkIcon);
consumer.consume(new LookupElementAction(icon, "Import statically") {
@Override
public Result performLookupAction() {
@@ -35,6 +35,7 @@ import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.psi.util.PsiUtil;
import com.intellij.util.containers.HashMap;
import com.intellij.util.ui.ColorIcon;
import com.intellij.util.ui.JBUI;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -153,7 +154,7 @@ public class VariableLookupItem extends LookupItem<PsiVariable> implements Typed
myHelper.renderElement(presentation, qualify, true, getSubstitutor());
}
if (myColor != null) {
presentation.setTypeText("", new ColorIcon(12, myColor));
presentation.setTypeText("", JBUI.scale(new ColorIcon(12, myColor)));
} else {
presentation.setTypeText(getType().getPresentableText());
}