mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-06 22:10:54 +03:00
ComboBox: increase maximum row count of popup list to 20 (was 8)
This commit is contained in:
@@ -20,6 +20,8 @@ FlatLaf Change Log
|
|||||||
[Glazed Lists](https://github.com/glazedlists/glazedlists). (issue #113)
|
[Glazed Lists](https://github.com/glazedlists/glazedlists). (issue #113)
|
||||||
- Button, CheckBox, RadioButton and ToggleButton: Do not paint focus indicator
|
- Button, CheckBox, RadioButton and ToggleButton: Do not paint focus indicator
|
||||||
if `AbstractButton.isFocusPainted()` returns `false`.
|
if `AbstractButton.isFocusPainted()` returns `false`.
|
||||||
|
- ComboBox: Increase maximum row count of popup list to 20 (was 8). Set UI value
|
||||||
|
`ComboBox.maximumRowCount` to any integer to use a different value.
|
||||||
- Fixed/improved vertical position of text when scaled on HiDPI screens on
|
- Fixed/improved vertical position of text when scaled on HiDPI screens on
|
||||||
Windows.
|
Windows.
|
||||||
|
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ import com.formdev.flatlaf.util.UIScale;
|
|||||||
*
|
*
|
||||||
* @uiDefault ComboBox.minimumWidth int
|
* @uiDefault ComboBox.minimumWidth int
|
||||||
* @uiDefault ComboBox.editorColumns int
|
* @uiDefault ComboBox.editorColumns int
|
||||||
|
* @uiDefault ComboBox.maximumRowCount int
|
||||||
* @uiDefault ComboBox.buttonStyle String auto (default), button or none
|
* @uiDefault ComboBox.buttonStyle String auto (default), button or none
|
||||||
* @uiDefault Component.arrowType String triangle (default) or chevron
|
* @uiDefault Component.arrowType String triangle (default) or chevron
|
||||||
* @uiDefault Component.isIntelliJTheme boolean
|
* @uiDefault Component.isIntelliJTheme boolean
|
||||||
@@ -172,6 +173,11 @@ public class FlatComboBoxUI
|
|||||||
buttonDisabledArrowColor = UIManager.getColor( "ComboBox.buttonDisabledArrowColor" );
|
buttonDisabledArrowColor = UIManager.getColor( "ComboBox.buttonDisabledArrowColor" );
|
||||||
buttonHoverArrowColor = UIManager.getColor( "ComboBox.buttonHoverArrowColor" );
|
buttonHoverArrowColor = UIManager.getColor( "ComboBox.buttonHoverArrowColor" );
|
||||||
|
|
||||||
|
// set maximumRowCount
|
||||||
|
int maximumRowCount = UIManager.getInt( "ComboBox.maximumRowCount" );
|
||||||
|
if( maximumRowCount > 0 && maximumRowCount != 8 && comboBox.getMaximumRowCount() == 8 )
|
||||||
|
comboBox.setMaximumRowCount( maximumRowCount );
|
||||||
|
|
||||||
// scale
|
// scale
|
||||||
padding = UIScale.scale( padding );
|
padding = UIScale.scale( padding );
|
||||||
|
|
||||||
|
|||||||
@@ -180,6 +180,7 @@ ComboBox.border=com.formdev.flatlaf.ui.FlatRoundBorder
|
|||||||
ComboBox.padding=2,6,2,6
|
ComboBox.padding=2,6,2,6
|
||||||
ComboBox.minimumWidth=72
|
ComboBox.minimumWidth=72
|
||||||
ComboBox.editorColumns=0
|
ComboBox.editorColumns=0
|
||||||
|
ComboBox.maximumRowCount=20
|
||||||
[mac]ComboBox.showPopupOnNavigation=true
|
[mac]ComboBox.showPopupOnNavigation=true
|
||||||
ComboBox.buttonStyle=auto
|
ComboBox.buttonStyle=auto
|
||||||
|
|
||||||
|
|||||||
@@ -604,6 +604,7 @@ public class FlatComponentsTest
|
|||||||
"jj",
|
"jj",
|
||||||
"kkk"
|
"kkk"
|
||||||
}));
|
}));
|
||||||
|
comboBox1.setMaximumRowCount(6);
|
||||||
add(comboBox1, "cell 1 5,growx");
|
add(comboBox1, "cell 1 5,growx");
|
||||||
|
|
||||||
//---- comboBox2 ----
|
//---- comboBox2 ----
|
||||||
@@ -632,6 +633,7 @@ public class FlatComponentsTest
|
|||||||
"jj",
|
"jj",
|
||||||
"kkk"
|
"kkk"
|
||||||
}));
|
}));
|
||||||
|
comboBox3.setMaximumRowCount(6);
|
||||||
add(comboBox3, "cell 3 5,growx");
|
add(comboBox3, "cell 3 5,growx");
|
||||||
|
|
||||||
//---- comboBox4 ----
|
//---- comboBox4 ----
|
||||||
|
|||||||
@@ -356,6 +356,7 @@ new FormModel {
|
|||||||
addElement( "jj" )
|
addElement( "jj" )
|
||||||
addElement( "kkk" )
|
addElement( "kkk" )
|
||||||
}
|
}
|
||||||
|
"maximumRowCount": 6
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 1 5,growx"
|
"value": "cell 1 5,growx"
|
||||||
} )
|
} )
|
||||||
@@ -390,6 +391,7 @@ new FormModel {
|
|||||||
addElement( "jj" )
|
addElement( "jj" )
|
||||||
addElement( "kkk" )
|
addElement( "kkk" )
|
||||||
}
|
}
|
||||||
|
"maximumRowCount": 6
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 3 5,growx"
|
"value": "cell 3 5,growx"
|
||||||
} )
|
} )
|
||||||
|
|||||||
@@ -196,6 +196,7 @@ ComboBox.editorColumns 0
|
|||||||
ComboBox.font [active] $defaultFont [UI]
|
ComboBox.font [active] $defaultFont [UI]
|
||||||
ComboBox.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI]
|
ComboBox.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI]
|
||||||
ComboBox.isEnterSelectablePopup false
|
ComboBox.isEnterSelectablePopup false
|
||||||
|
ComboBox.maximumRowCount 20
|
||||||
ComboBox.minimumWidth 72
|
ComboBox.minimumWidth 72
|
||||||
ComboBox.noActionOnKeyNavigation false
|
ComboBox.noActionOnKeyNavigation false
|
||||||
ComboBox.padding 2,6,2,6 javax.swing.plaf.InsetsUIResource [UI]
|
ComboBox.padding 2,6,2,6 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
|
|||||||
@@ -200,6 +200,7 @@ ComboBox.editorColumns 0
|
|||||||
ComboBox.font [active] $defaultFont [UI]
|
ComboBox.font [active] $defaultFont [UI]
|
||||||
ComboBox.foreground #000000 javax.swing.plaf.ColorUIResource [UI]
|
ComboBox.foreground #000000 javax.swing.plaf.ColorUIResource [UI]
|
||||||
ComboBox.isEnterSelectablePopup false
|
ComboBox.isEnterSelectablePopup false
|
||||||
|
ComboBox.maximumRowCount 20
|
||||||
ComboBox.minimumWidth 72
|
ComboBox.minimumWidth 72
|
||||||
ComboBox.noActionOnKeyNavigation false
|
ComboBox.noActionOnKeyNavigation false
|
||||||
ComboBox.padding 2,6,2,6 javax.swing.plaf.InsetsUIResource [UI]
|
ComboBox.padding 2,6,2,6 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
|
|||||||
Reference in New Issue
Block a user