mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-13 07:17:13 -06:00
ComboBox: fixed painting background outside of border if Component.arc is set to a large value
This commit is contained in:
@@ -5,6 +5,9 @@ FlatLaf Change Log
|
|||||||
|
|
||||||
- Added drop shadows to popup menus, combobox popups, tooltips and internal
|
- Added drop shadows to popup menus, combobox popups, tooltips and internal
|
||||||
frames. (issue #94)
|
frames. (issue #94)
|
||||||
|
- Paint nicely rounded buttons, comboboxes, spinners and text fields when
|
||||||
|
setting `Button.arc`, `Component.arc` or `TextComponent.arc` to a large value
|
||||||
|
(e.g. 1000).
|
||||||
- Added Java 9 module descriptor to `flatlaf-extras-<version>.jar` and
|
- Added Java 9 module descriptor to `flatlaf-extras-<version>.jar` and
|
||||||
`flatlaf-swingx-<version>.jar`.
|
`flatlaf-swingx-<version>.jar`.
|
||||||
|
|
||||||
|
|||||||
@@ -319,7 +319,7 @@ public class FlatComboBoxUI
|
|||||||
@Override
|
@Override
|
||||||
public void update( Graphics g, JComponent c ) {
|
public void update( Graphics g, JComponent c ) {
|
||||||
// fill background if opaque to avoid garbage if user sets opaque to true
|
// fill background if opaque to avoid garbage if user sets opaque to true
|
||||||
if( c.isOpaque() && (focusWidth > 0 || arc != 0) )
|
if( c.isOpaque() && (focusWidth > 0 || arc > 0) )
|
||||||
FlatUIUtils.paintParentBackground( g, c );
|
FlatUIUtils.paintParentBackground( g, c );
|
||||||
|
|
||||||
Graphics2D g2 = (Graphics2D) g;
|
Graphics2D g2 = (Graphics2D) g;
|
||||||
@@ -394,8 +394,7 @@ public class FlatComboBoxUI
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void paintCurrentValueBackground( Graphics g, Rectangle bounds, boolean hasFocus ) {
|
public void paintCurrentValueBackground( Graphics g, Rectangle bounds, boolean hasFocus ) {
|
||||||
g.setColor( comboBox.isEnabled() ? comboBox.getBackground() : getDisabledBackground( comboBox ) );
|
// not necessary because already painted in update()
|
||||||
g.fillRect( bounds.x, bounds.y, bounds.width, bounds.height );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Color getDisabledBackground( JComponent c ) {
|
private Color getDisabledBackground( JComponent c ) {
|
||||||
|
|||||||
Reference in New Issue
Block a user