mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-11 06:27:13 -06:00
Renamed borderLess to borderless
This commit is contained in:
@@ -41,7 +41,7 @@ public interface FlatClientProperties
|
||||
* {@link #BUTTON_TYPE_TAB},
|
||||
* {@link #BUTTON_TYPE_HELP} or
|
||||
* {@link #BUTTON_TYPE_TOOLBAR_BUTTON}
|
||||
* {@link #BUTTON_TYPE_BORDER_LESS}
|
||||
* {@link #BUTTON_TYPE_BORDERLESS}
|
||||
*/
|
||||
String BUTTON_TYPE = "JButton.buttonType";
|
||||
|
||||
@@ -97,7 +97,7 @@ public interface FlatClientProperties
|
||||
*
|
||||
* @see #BUTTON_TYPE
|
||||
*/
|
||||
String BUTTON_TYPE_BORDER_LESS = "borderLess";
|
||||
String BUTTON_TYPE_BORDERLESS = "borderless";
|
||||
|
||||
/**
|
||||
* Specifies selected state of a checkbox.
|
||||
|
||||
@@ -75,7 +75,7 @@ public class FlatButtonBorder
|
||||
public void paintBorder( Component c, Graphics g, int x, int y, int width, int height ) {
|
||||
if( FlatButtonUI.isContentAreaFilled( c ) &&
|
||||
!FlatButtonUI.isToolBarButton( c ) &&
|
||||
( !FlatButtonUI.isBorderLessButton( c ) || FlatUIUtils.isPermanentFocusOwner( c ) ) &&
|
||||
( !FlatButtonUI.isBorderlessButton( c ) || FlatUIUtils.isPermanentFocusOwner( c ) ) &&
|
||||
!FlatButtonUI.isHelpButton( c ) &&
|
||||
!FlatToggleButtonUI.isTabButton( c ) )
|
||||
super.paintBorder( c, g, x, y, width, height );
|
||||
|
||||
@@ -285,8 +285,9 @@ public class FlatButtonUI
|
||||
(c instanceof AbstractButton && clientPropertyEquals( (AbstractButton) c, BUTTON_TYPE, BUTTON_TYPE_TOOLBAR_BUTTON ));
|
||||
}
|
||||
|
||||
static boolean isBorderLessButton( Component c ) {
|
||||
return c instanceof AbstractButton && clientPropertyEquals( (AbstractButton) c, BUTTON_TYPE, BUTTON_TYPE_BORDER_LESS );
|
||||
static boolean isBorderlessButton( Component c ) {
|
||||
return c instanceof AbstractButton && clientPropertyEquals( (AbstractButton) c, BUTTON_TYPE,
|
||||
BUTTON_TYPE_BORDERLESS );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -336,7 +337,7 @@ public class FlatButtonUI
|
||||
|
||||
// paint shadow
|
||||
Color shadowColor = def ? defaultShadowColor : this.shadowColor;
|
||||
if( !isToolBarButton && !isBorderLessButton( c ) && shadowColor != null && shadowWidth > 0 && focusWidth > 0 &&
|
||||
if( !isToolBarButton && !isBorderlessButton( c ) && shadowColor != null && shadowWidth > 0 && focusWidth > 0 &&
|
||||
!(isFocusPainted( c ) && FlatUIUtils.isPermanentFocusOwner( c )) && c.isEnabled() )
|
||||
{
|
||||
g2.setColor( shadowColor );
|
||||
@@ -395,7 +396,7 @@ public class FlatButtonUI
|
||||
if( ((AbstractButton)c).isSelected() ) {
|
||||
// in toolbar use same colors for disabled and enabled because
|
||||
// we assume that toolbar icon is shown disabled
|
||||
boolean toolBarButton = isToolBarButton( c ) || isBorderLessButton( c );
|
||||
boolean toolBarButton = isToolBarButton( c ) || isBorderlessButton( c );
|
||||
return buttonStateColor( c,
|
||||
toolBarButton ? toolbarSelectedBackground : selectedBackground,
|
||||
toolBarButton ? toolbarSelectedBackground : disabledSelectedBackground,
|
||||
@@ -407,7 +408,7 @@ public class FlatButtonUI
|
||||
return disabledBackground;
|
||||
|
||||
// toolbar button
|
||||
if( isToolBarButton( c ) || isBorderLessButton( c ) ) {
|
||||
if( isToolBarButton( c ) || isBorderlessButton( c ) ) {
|
||||
ButtonModel model = ((AbstractButton)c).getModel();
|
||||
if( model.isPressed() )
|
||||
return toolbarPressedBackground;
|
||||
@@ -469,7 +470,7 @@ public class FlatButtonUI
|
||||
if( !c.isEnabled() )
|
||||
return disabledText;
|
||||
|
||||
if( ((AbstractButton)c).isSelected() && !( isToolBarButton( c ) || isBorderLessButton( c ) ) )
|
||||
if( ((AbstractButton)c).isSelected() && !( isToolBarButton( c ) || isBorderlessButton( c ) ) )
|
||||
return selectedForeground;
|
||||
|
||||
// use component foreground if explicitly set
|
||||
|
||||
@@ -30,7 +30,7 @@ public class FlatButton
|
||||
implements FlatComponentExtension
|
||||
{
|
||||
// NOTE: enum names must be equal to allowed strings
|
||||
public enum ButtonType { none, square, roundRect, tab, help, toolBarButton, borderLess }
|
||||
public enum ButtonType { none, square, roundRect, tab, help, toolBarButton, borderless}
|
||||
|
||||
/**
|
||||
* Returns type of a button.
|
||||
|
||||
Reference in New Issue
Block a user