mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-11 06:27: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
|
||||
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
|
||||
`flatlaf-swingx-<version>.jar`.
|
||||
|
||||
|
||||
@@ -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 ) {
|
||||
|
||||
Reference in New Issue
Block a user