mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-13 15:27:16 -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)
This commit is contained in:
@@ -13,6 +13,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)
|
||||||
- Tree: Fixed editing cell issue with custom cell renderer and cell editor that
|
- Tree: Fixed editing cell issue with custom cell renderer and cell editor that
|
||||||
use same component for rendering and editing. (issue #385)
|
use same component for rendering and editing. (issue #385)
|
||||||
|
|
||||||
@@ -41,7 +44,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
|
||||||
|
|||||||
@@ -555,6 +555,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