mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
ui: better alignment for RadioButton text
In Intellij Light LaF checkbox and radiobutton icons have different width. Adjust icon gap accordingly to align their label texts. GitOrigin-RevId: efa1f1ca9f3c11da39b67a856fef90264c608291
This commit is contained in:
committed by
intellij-monorepo-bot
parent
eaa13efbc7
commit
2290c6bc31
+10
-2
@@ -31,7 +31,7 @@ public class DarculaRadioButtonUI extends MetalRadioButtonUI {
|
||||
@Override
|
||||
public void installDefaults(AbstractButton b) {
|
||||
super.installDefaults(b);
|
||||
b.setIconTextGap(textIconGap());
|
||||
b.setIconTextGap(textIconGap(b));
|
||||
updateTextPosition(b);
|
||||
}
|
||||
|
||||
@@ -47,7 +47,15 @@ public class DarculaRadioButtonUI extends MetalRadioButtonUI {
|
||||
button.removePropertyChangeListener(AbstractButton.TEXT_CHANGED_PROPERTY, textChangedListener);
|
||||
}
|
||||
|
||||
protected int textIconGap() {
|
||||
protected int textIconGap(AbstractButton b) {
|
||||
Object gap = UIManager.get("RadioButton.iconTextGap");
|
||||
if (gap != null) {
|
||||
try {
|
||||
return JBUIScale.scale(Integer.parseInt(gap.toString()));
|
||||
}
|
||||
catch (NumberFormatException ignored) {
|
||||
}
|
||||
}
|
||||
return JBUIScale.scale(4);
|
||||
}
|
||||
|
||||
|
||||
@@ -143,6 +143,7 @@ ComboBox.ArrowButton.disabledIconColor=ABABAB
|
||||
RadioButtonUI=com.intellij.ide.ui.laf.darcula.ui.DarculaRadioButtonUI
|
||||
RadioButton.border=com.intellij.ide.ui.laf.darcula.ui.DarculaRadioButtonBorder
|
||||
RadioButton.borderInsets=2,2,2,0
|
||||
RadioButton.iconTextGap=3
|
||||
RadioButton.darcula.selectionEnabledColor=ffffff
|
||||
RadioButton.darcula.selectionDisabledColor=aaaaaa
|
||||
RadioButton.darcula.selectionEnabledShadowColor=00000040
|
||||
|
||||
@@ -27,7 +27,7 @@ public class MacIntelliJRadioButtonUI extends DarculaRadioButtonUI {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int textIconGap() {
|
||||
protected int textIconGap(AbstractButton b) {
|
||||
return JBUIScale.scale(3);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user