mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-11 06:27:13 -06:00
bug: AbstractButton's ContentAreaFilled=false not honored when parent is a CellRendererPane
This commit is contained in:
@@ -11,6 +11,8 @@ FlatLaf Change Log
|
||||
- TabbedPane: New option to allow tab separators to take full height (to enable
|
||||
use `UIManager.put( "TabbedPane.tabSeparatorsFullHeight", true );`). (issue
|
||||
#59, PR #62)
|
||||
- CheckBox and RadioButton: Do not fill background if `contentAreaFilled` is
|
||||
`false`. (issue #58, PR #63)
|
||||
|
||||
|
||||
## 0.26
|
||||
|
||||
@@ -118,11 +118,13 @@ public class FlatRadioButtonUI
|
||||
|
||||
@Override
|
||||
public void paint( Graphics g, JComponent c ) {
|
||||
// fill background even if opaque if
|
||||
// - used as cell renderer (because of selection background)
|
||||
// - if background was explicitly set to a non-UIResource color
|
||||
// fill background even if not opaque if
|
||||
// - contentAreaFilled is true and
|
||||
// - used as cell renderer (because of selection background)
|
||||
// - or if background was explicitly set to a non-UIResource color
|
||||
if( !c.isOpaque() &&
|
||||
(c.getParent() instanceof CellRendererPane || !(c.getBackground() instanceof UIResource)) )
|
||||
((AbstractButton)c).isContentAreaFilled() &&
|
||||
(c.getParent() instanceof CellRendererPane || !(c.getBackground() instanceof UIResource)))
|
||||
{
|
||||
g.setColor( c.getBackground() );
|
||||
g.fillRect( 0, 0, c.getWidth(), c.getHeight() );
|
||||
|
||||
Reference in New Issue
Block a user