mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-06 14:00:55 +03:00
bug: AbstractButton's ContentAreaFilled=false not honored when parent is a CellRendererPane
docs: AbstractButton:setContentAreaFilled Sets the contentAreaFilled property. If true the button will paint the content area. If you wish to have a transparent button, such as an icon only button, for example, then you should set this to false. Do not call setOpaque(false). The default value for the the contentAreaFilled property is true. This function may cause the component's opaque property to change. The exact behavior of calling this function varies on a component-by-component and L&F-by-L&F basis. Parameters: b - if true, the content should be filled; if false the content area is not filled
This commit is contained in:
@@ -121,8 +121,9 @@ public class FlatRadioButtonUI
|
||||
// fill background even if opaque if
|
||||
// - used as cell renderer (because of selection background)
|
||||
// - if background was explicitly set to a non-UIResource color
|
||||
if( !c.isOpaque() &&
|
||||
(c.getParent() instanceof CellRendererPane || !(c.getBackground() instanceof UIResource)) )
|
||||
if( ( !c.isOpaque() &&
|
||||
(c.getParent() instanceof CellRendererPane || !(c.getBackground() instanceof UIResource)))
|
||||
|| c instanceof AbstractButton && ((AbstractButton) c).isContentAreaFilled() )
|
||||
{
|
||||
g.setColor( c.getBackground() );
|
||||
g.fillRect( 0, 0, c.getWidth(), c.getHeight() );
|
||||
|
||||
Reference in New Issue
Block a user