mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-127954 right combobox action buttons on settings panel enable/disable behaviour
This commit is contained in:
@@ -110,10 +110,10 @@ public abstract class ComboBoxAction extends AnAction implements CustomComponent
|
||||
private boolean myMouseInside = false;
|
||||
private JBPopup myPopup;
|
||||
private boolean myForceTransparent = false;
|
||||
private Boolean myForceEnabled = null;
|
||||
|
||||
public ComboBoxButton(Presentation presentation) {
|
||||
myPresentation = presentation;
|
||||
setEnabled(myPresentation.isEnabled());
|
||||
setModel(new MyButtonModel());
|
||||
setHorizontalAlignment(LEFT);
|
||||
setFocusable(false);
|
||||
@@ -207,12 +207,6 @@ public abstract class ComboBoxAction extends AnAction implements CustomComponent
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setEnabled(final boolean enabled) {
|
||||
super.setEnabled(enabled);
|
||||
myForceEnabled = enabled;
|
||||
}
|
||||
|
||||
public void setForceTransparent(boolean transparent) {
|
||||
myForceTransparent = transparent;
|
||||
}
|
||||
@@ -282,7 +276,6 @@ public abstract class ComboBoxAction extends AnAction implements CustomComponent
|
||||
|
||||
private void initButton() {
|
||||
setIcon(myPresentation.getIcon());
|
||||
setEnabled(myPresentation.isEnabled());
|
||||
setText(myPresentation.getText());
|
||||
updateTooltipText(myPresentation.getDescription());
|
||||
updateButtonSize();
|
||||
@@ -383,7 +376,7 @@ public abstract class ComboBoxAction extends AnAction implements CustomComponent
|
||||
final Dimension size = getSize();
|
||||
final boolean isEmpty = getIcon() == null && StringUtil.isEmpty(getText());
|
||||
|
||||
final Color textColor = (myForceEnabled == null ? myPresentation.isEnabled() : myForceEnabled)
|
||||
final Color textColor = isEnabled()
|
||||
? UIManager.getColor("Panel.foreground")
|
||||
: UIUtil.getInactiveTextColor();
|
||||
if (myForceTransparent) {
|
||||
|
||||
Reference in New Issue
Block a user