mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-13 23:37:13 -06:00
ComboBox (not editable): fixed background painted outside of border if round edges are enabled (similar to issue #382; regression since fixing #330 in FlatLaf 1.4)
(cherry picked from commit 02f3239669)
This commit is contained in:
@@ -5,6 +5,9 @@ FlatLaf Change Log
|
|||||||
|
|
||||||
#### Fixed bugs
|
#### Fixed bugs
|
||||||
|
|
||||||
|
- ComboBox (not editable): Fixed background painted outside of border if round
|
||||||
|
edges are enabled (client property `JComponent.roundRect` is `true`). (similar
|
||||||
|
to issue #382; regression since fixing #330 in FlatLaf 1.4)
|
||||||
- Table: Do not select text in cell editor when it gets focus (when
|
- Table: Do not select text in cell editor when it gets focus (when
|
||||||
`JTable.surrendersFocusOnKeystroke` is `true`) and
|
`JTable.surrendersFocusOnKeystroke` is `true`) and
|
||||||
`TextComponent.selectAllOnFocusPolicy` is `once` (the default) or `always`.
|
`TextComponent.selectAllOnFocusPolicy` is `once` (the default) or `always`.
|
||||||
@@ -43,7 +46,7 @@ FlatLaf Change Log
|
|||||||
- ComboBox (editable): Fixed wrong border of internal text field under special
|
- ComboBox (editable): Fixed wrong border of internal text field under special
|
||||||
circumstances.
|
circumstances.
|
||||||
- Spinner: Fixed painting of border corners on left side. (issue #382;
|
- Spinner: Fixed painting of border corners on left side. (issue #382;
|
||||||
regression since FlatLaf 1.4)
|
regression since fixing #330 in FlatLaf 1.4)
|
||||||
- TableHeader: Do not show resize cursor for last column if resizing last column
|
- TableHeader: Do not show resize cursor for last column if resizing last column
|
||||||
is not possible because auto resize mode of table is not off. (issue #332)
|
is not possible because auto resize mode of table is not off. (issue #332)
|
||||||
- TableHeader: Fixed missing trailing vertical separator line if used in upper
|
- TableHeader: Fixed missing trailing vertical separator line if used in upper
|
||||||
|
|||||||
@@ -482,6 +482,22 @@ public class FlatComboBoxUI
|
|||||||
@Override
|
@Override
|
||||||
@SuppressWarnings( "unchecked" )
|
@SuppressWarnings( "unchecked" )
|
||||||
public void paintCurrentValue( Graphics g, Rectangle bounds, boolean hasFocus ) {
|
public void paintCurrentValue( Graphics g, Rectangle bounds, boolean hasFocus ) {
|
||||||
|
// apply clipping using rounded rectangle to avoid that renderer paints
|
||||||
|
// outside of border if combobox uses larger arc for edges
|
||||||
|
// (e.g. FlatClientProperties.COMPONENT_ROUND_RECT is true)
|
||||||
|
FlatBorder border = FlatUIUtils.getOutsideFlatBorder( comboBox );
|
||||||
|
if( border != null ) {
|
||||||
|
int clipArc = border.getArc( comboBox ) - (border.getLineWidth( comboBox ) * 2);
|
||||||
|
if( clipArc > 0 ) {
|
||||||
|
int x = bounds.x;
|
||||||
|
int width = bounds.width + bounds.height;
|
||||||
|
if( !comboBox.getComponentOrientation().isLeftToRight() )
|
||||||
|
x -= bounds.height;
|
||||||
|
((Graphics2D)g).clip( FlatUIUtils.createComponentRectangle(
|
||||||
|
x, bounds.y, width, bounds.height, scale( (float) clipArc ) ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
paddingBorder.uninstall();
|
paddingBorder.uninstall();
|
||||||
|
|
||||||
ListCellRenderer<Object> renderer = comboBox.getRenderer();
|
ListCellRenderer<Object> renderer = comboBox.getRenderer();
|
||||||
|
|||||||
Reference in New Issue
Block a user