mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Fix minor in JBUI.insets, leverage right insets in Darcula checkbox/radiobutton borders.
This commit is contained in:
@@ -744,15 +744,15 @@ public class FindPopupPanel extends JBPanel implements FindUI {
|
||||
myTitlePanel.add(myTitleLabel);
|
||||
myTitlePanel.add(myLoadingDecorator.getComponent(), "w 24, wmin 24");
|
||||
myTitlePanel.add(Box.createHorizontalGlue(), "growx, pushx");
|
||||
int gap = JBUI.scale(16);
|
||||
int gap = 16;
|
||||
JPanel regexpPanel = new JPanel(new BorderLayout(JBUI.scale(4), 0));
|
||||
regexpPanel.add(myCbRegularExpressions, BorderLayout.CENTER);
|
||||
regexpPanel.add(RegExHelpPopup.createRegExLink("<html><body><b>?</b></body></html>", myCbRegularExpressions, LOG), BorderLayout.EAST);
|
||||
AnAction[] actions = {
|
||||
new DefaultCustomComponentAction(() -> JBUI.Borders.emptyRight(gap).wrap(myCbCaseSensitive)),
|
||||
new DefaultCustomComponentAction(() -> JBUI.Borders.emptyRight(gap).wrap(myCbPreserveCase)),
|
||||
new DefaultCustomComponentAction(() -> JBUI.Borders.emptyRight(gap).wrap(myCbWholeWordsOnly)),
|
||||
new DefaultCustomComponentAction(() -> regexpPanel),
|
||||
new DefaultCustomComponentAction(() -> myCbCaseSensitive),
|
||||
new DefaultCustomComponentAction(() -> JBUI.Borders.emptyLeft(gap).wrap(myCbPreserveCase)),
|
||||
new DefaultCustomComponentAction(() -> JBUI.Borders.emptyLeft(gap).wrap(myCbWholeWordsOnly)),
|
||||
new DefaultCustomComponentAction(() -> JBUI.Borders.emptyLeft(gap).wrap(regexpPanel)),
|
||||
};
|
||||
|
||||
@SuppressWarnings("InspectionUniqueToolbarId")
|
||||
|
||||
@@ -71,6 +71,9 @@ public class DarculaCheckBoxUI extends MetalCheckBoxUI {
|
||||
}
|
||||
|
||||
protected Rectangle updateViewRect(AbstractButton b, Rectangle viewRect) {
|
||||
if (!(b.getBorder() instanceof DarculaCheckBoxBorder)) {
|
||||
JBInsets.removeFrom(viewRect, b.getInsets());
|
||||
}
|
||||
return viewRect;
|
||||
}
|
||||
|
||||
|
||||
+3
@@ -65,6 +65,9 @@ public class DarculaRadioButtonUI extends MetalRadioButtonUI {
|
||||
}
|
||||
|
||||
protected Rectangle updateViewRect(AbstractButton b, Rectangle viewRect) {
|
||||
if (!(b.getBorder() instanceof DarculaRadioButtonBorder)) {
|
||||
JBInsets.removeFrom(viewRect, b.getInsets());
|
||||
}
|
||||
return viewRect;
|
||||
}
|
||||
|
||||
|
||||
@@ -519,8 +519,8 @@ public class JBUI {
|
||||
|
||||
@NotNull
|
||||
public static JBInsets insets(String propName, JBInsets defaultValue) {
|
||||
JBInsets i = (JBInsets)UIManager.getInsets(propName);
|
||||
return i != null ? i : defaultValue;
|
||||
Insets i = UIManager.getInsets(propName);
|
||||
return i != null ? JBInsets.create(i) : defaultValue;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
Reference in New Issue
Block a user