IDEA-85375 Run configurations dropbox should not change its width

Limit minimum width for Run Configurations combobox
This commit is contained in:
Vassiliy.Kudryashov
2017-09-14 20:13:05 +03:00
parent a666267179
commit db252041b0
2 changed files with 9 additions and 4 deletions
@@ -122,7 +122,14 @@ public class RunConfigurationsComboBoxAction extends ComboBoxAction implements D
@Override
public JComponent createCustomComponent(final Presentation presentation) {
ComboBoxButton button = createComboBoxButton(presentation);
ComboBoxButton button = new ComboBoxButton(presentation) {
@Override
public Dimension getPreferredSize() {
Dimension d = super.getPreferredSize();
d.width = Math.max(d.width, JBUI.scale(75));
return d;
}
};
NonOpaquePanel panel = new NonOpaquePanel(new BorderLayout());
panel.setBorder(JBUI.Borders.emptyRight(2));
panel.add(button);
@@ -484,9 +484,7 @@ public abstract class ComboBoxAction extends AnAction implements CustomComponent
boolean isEmpty = getIcon() == null && StringUtil.isEmpty(getText());
int x = size.width - icon.getIconWidth();
if (isEmpty) {
x /= 2;
} else {
if (!isEmpty) {
if (UIUtil.isUnderWin10LookAndFeel()) {
x -= JBUI.scale(6);
x -= JBUI.scale(UIUtil.getParentOfType(ActionToolbar.class, this) != null ? 2 : 0);