diff --git a/CHANGELOG.md b/CHANGELOG.md index 973f181b..89fe2035 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ FlatLaf Change Log - Added drop shadows to popup menus, combobox popups, tooltips and internal 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-.jar` and `flatlaf-swingx-.jar`. diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatComboBoxUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatComboBoxUI.java index c7730e34..97204d54 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatComboBoxUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatComboBoxUI.java @@ -319,7 +319,7 @@ public class FlatComboBoxUI @Override public void update( Graphics g, JComponent c ) { // 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 ); Graphics2D g2 = (Graphics2D) g; @@ -394,8 +394,7 @@ public class FlatComboBoxUI @Override public void paintCurrentValueBackground( Graphics g, Rectangle bounds, boolean hasFocus ) { - g.setColor( comboBox.isEnabled() ? comboBox.getBackground() : getDisabledBackground( comboBox ) ); - g.fillRect( bounds.x, bounds.y, bounds.width, bounds.height ); + // not necessary because already painted in update() } private Color getDisabledBackground( JComponent c ) {