mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-180544 'Suppress' button in 'Inspection result' window have visual problem
This commit is contained in:
+12
-35
@@ -282,10 +282,6 @@ public abstract class ComboBoxAction extends AnAction implements CustomComponent
|
||||
return createActionPopup(getDataContext(), this, onDispose);
|
||||
}
|
||||
|
||||
private ComboBoxAction getMyAction() {
|
||||
return ComboBoxAction.this;
|
||||
}
|
||||
|
||||
protected DataContext getDataContext() {
|
||||
return DataManager.getInstance().getDataContext(this);
|
||||
}
|
||||
@@ -321,15 +317,6 @@ public abstract class ComboBoxAction extends AnAction implements CustomComponent
|
||||
setToolTipText(!tooltip.isEmpty() ? tooltip : null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateUI() {
|
||||
super.updateUI();
|
||||
//if (!UIUtil.isUnderGTKLookAndFeel()) {
|
||||
// setBorder(UIUtil.getButtonBorder());
|
||||
//}
|
||||
//((JComponent)getParent().getParent()).revalidate();
|
||||
}
|
||||
|
||||
protected class MyButtonModel extends DefaultButtonModel {
|
||||
@Override
|
||||
public boolean isPressed() {
|
||||
@@ -363,20 +350,6 @@ public abstract class ComboBoxAction extends AnAction implements CustomComponent
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Insets getInsets() {
|
||||
final Insets insets = super.getInsets();
|
||||
insets.right += getArrowIcon(isEnabled()).getIconWidth();
|
||||
return insets;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Insets getInsets(Insets insets) {
|
||||
final Insets result = super.getInsets(insets);
|
||||
result.right += getArrowIcon(isEnabled()).getIconWidth();
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaque() {
|
||||
return !isSmallVariant();
|
||||
@@ -384,13 +357,12 @@ public abstract class ComboBoxAction extends AnAction implements CustomComponent
|
||||
|
||||
@Override
|
||||
public Dimension getPreferredSize() {
|
||||
final boolean isEmpty = getIcon() == null && StringUtil.isEmpty(getText());
|
||||
int width = isEmpty ? JBUI.scale(10) + getArrowIcon(isEnabled()).getIconWidth() : super.getPreferredSize().width;
|
||||
if (isSmallVariant() && !UIUtil.isUnderDefaultMacTheme()) {
|
||||
width += JBUI.scale(4);
|
||||
if (UIUtil.isUnderWin10LookAndFeel()) {
|
||||
width += JBUI.scale(8);
|
||||
}
|
||||
boolean isEmpty = getIcon() == null && StringUtil.isEmpty(getText());
|
||||
int width = isEmpty ? JBUI.scale(10) : super.getPreferredSize().width;
|
||||
width += getArrowIcon(isEnabled()).getIconWidth();
|
||||
if (isSmallVariant()) {
|
||||
int extraWidth = UIUtil.isUnderDefaultMacTheme() || UIUtil.isUnderWin10LookAndFeel() ? 0 : JBUI.scale(4);
|
||||
width += extraWidth;
|
||||
}
|
||||
|
||||
int height = UIUtil.isUnderWin10LookAndFeel() ? JBUI.scale(24) : JBUI.scale(19);
|
||||
@@ -479,7 +451,7 @@ public abstract class ComboBoxAction extends AnAction implements CustomComponent
|
||||
}
|
||||
}
|
||||
|
||||
Insets insets = super.getInsets();
|
||||
Insets insets = getInsets();
|
||||
Icon icon = getArrowIcon(isEnabled());
|
||||
|
||||
int x = size.width - icon.getIconWidth();
|
||||
@@ -506,6 +478,11 @@ public abstract class ComboBoxAction extends AnAction implements CustomComponent
|
||||
g.setPaintMode();
|
||||
}
|
||||
|
||||
@Override public void updateUI() {
|
||||
super.updateUI();
|
||||
updateButtonSize();
|
||||
}
|
||||
|
||||
protected void updateButtonSize() {
|
||||
invalidate();
|
||||
repaint();
|
||||
|
||||
+3
-5
@@ -82,14 +82,12 @@ public class WinIntelliJButtonBorder implements Border, UIResource {
|
||||
|
||||
@Override
|
||||
public Insets getBorderInsets(Component c) {
|
||||
if (DarculaButtonUI.isComboButton((JComponent)c)) {
|
||||
return JBUI.insets(2).asUIResource();
|
||||
} else if (UIUtil.getParentOfType(ActionToolbar.class, c) != null) {
|
||||
return JBUI.insets(4, 16, 4, 19).asUIResource();
|
||||
} else if (isSquare(c)) {
|
||||
if (isSquare(c)) {
|
||||
return JBUI.insets(2).asUIResource();
|
||||
} else if (DarculaButtonUI.isHelpButton((JComponent)c)) {
|
||||
return JBUI.insets(0, 0, 0, 10).asUIResource();
|
||||
} else if (DarculaButtonUI.isComboButton((JComponent)c)) {
|
||||
return JBUI.insets(4, 10).asUIResource();
|
||||
} else {
|
||||
return JBUI.insets(4, 18).asUIResource();
|
||||
}
|
||||
|
||||
+3
-1
@@ -114,7 +114,9 @@ public class WinIntelliJButtonUI extends DarculaButtonUI {
|
||||
}
|
||||
|
||||
if (isComboButton(b)) {
|
||||
rect.x += JBUI.scale(5);
|
||||
int delta = JBUI.scale(6);
|
||||
rect.x += delta;
|
||||
rect.width -= delta;
|
||||
} else if (b instanceof JBOptionButton) {
|
||||
rect.x -= JBUI.scale(4);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user