@Override public Dimension getMinimumSize(JComponent c) { if (!this.isMinimumSizeDirty) { return new Dimension(this.cachedMinimumSize); } // Dimension size = null; // // if (!this.comboBox.isEditable() && this.arrowButton != null // && this.arrowButton instanceof SubstanceComboBoxButton) { // SubstanceDropDownButton button = (SubstanceDropDownButton) this.arrowButton; Insets buttonInsets = button.getInsets(); Insets insets = this.comboBox.getInsets(); Dimension size = this.getDisplaySize(); size.width += insets.left + insets.right; size.width += buttonInsets.left + buttonInsets.right; size.width += button.getMinimumSize().getWidth(); size.height += insets.top + insets.bottom; // } else if (this.comboBox.isEditable() && this.arrowButton != null // && this.editor != null) { // size = super.getMinimumSize(c); // } else { // size = super.getMinimumSize(c); // } this.cachedMinimumSize.setSize(size.width, size.height); this.isMinimumSizeDirty = false; return new Dimension(this.cachedMinimumSize); }
@Override public Dimension getMinimumSize(JComponent c) { if (!this.isMinimumSizeDirty) { return new Dimension(this.cachedMinimumSize); } // Dimension size = null; // // if (!this.comboBox.isEditable() && this.arrowButton != null // && this.arrowButton instanceof SubstanceComboBoxButton) { // SubstanceDropDownButton button = (SubstanceDropDownButton) this.arrowButton; Insets buttonInsets = button.getInsets(); Insets insets = this.comboBox.getInsets(); Dimension size = this.getDisplaySize(); size.width += insets.left + insets.right; size.width += buttonInsets.left + buttonInsets.right; size.width += button.getMinimumSize().getWidth(); size.height += insets.top + insets.bottom; // } else if (this.comboBox.isEditable() && this.arrowButton != null // && this.editor != null) { // size = super.getMinimumSize(c); // } else { // size = super.getMinimumSize(c); // } this.cachedMinimumSize.setSize(size.width, size.height); this.isMinimumSizeDirty = false; return new Dimension(this.cachedMinimumSize); }