mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-13 15:27:16 -06:00
@@ -226,6 +226,13 @@ public interface FlatClientProperties
|
||||
*/
|
||||
String OUTLINE = "JComponent.outline";
|
||||
|
||||
/**
|
||||
* Paint the component border in another color (usually greenish) to indicate an success.
|
||||
*
|
||||
* @see #OUTLINE
|
||||
*/
|
||||
String OUTLINE_SUCCESS = "success";
|
||||
|
||||
/**
|
||||
* Paint the component border in another color (usually reddish) to indicate an error.
|
||||
*
|
||||
|
||||
@@ -55,6 +55,8 @@ import com.formdev.flatlaf.util.DerivedColor;
|
||||
* @uiDefault Component.disabledBorderColor Color
|
||||
* @uiDefault Component.focusedBorderColor Color
|
||||
*
|
||||
* @uiDefault Component.success.borderColor Color
|
||||
* @uiDefault Component.success.focusedBorderColor Color
|
||||
* @uiDefault Component.error.borderColor Color
|
||||
* @uiDefault Component.error.focusedBorderColor Color
|
||||
* @uiDefault Component.warning.borderColor Color
|
||||
@@ -77,6 +79,8 @@ public class FlatBorder
|
||||
@Styleable protected Color disabledBorderColor = UIManager.getColor( "Component.disabledBorderColor" );
|
||||
@Styleable protected Color focusedBorderColor = UIManager.getColor( "Component.focusedBorderColor" );
|
||||
|
||||
@Styleable(dot=true) protected Color successBorderColor = UIManager.getColor( "Component.success.borderColor" );
|
||||
@Styleable(dot=true) protected Color successFocusedBorderColor = UIManager.getColor( "Component.success.focusedBorderColor" );
|
||||
@Styleable(dot=true) protected Color errorBorderColor = UIManager.getColor( "Component.error.borderColor" );
|
||||
@Styleable(dot=true) protected Color errorFocusedBorderColor = UIManager.getColor( "Component.error.focusedBorderColor" );
|
||||
@Styleable(dot=true) protected Color warningBorderColor = UIManager.getColor( "Component.warning.borderColor" );
|
||||
@@ -163,6 +167,9 @@ public class FlatBorder
|
||||
|
||||
if( outline instanceof String ) {
|
||||
switch( (String) outline ) {
|
||||
case FlatClientProperties.OUTLINE_SUCCESS:
|
||||
return isFocused( c ) ? successFocusedBorderColor : successBorderColor;
|
||||
|
||||
case FlatClientProperties.OUTLINE_ERROR:
|
||||
return isFocused( c ) ? errorFocusedBorderColor : errorBorderColor;
|
||||
|
||||
|
||||
@@ -183,6 +183,8 @@ Component.linkColor = @accentLinkColor
|
||||
Component.accentColor = if(@accentColor, @accentColor, @accentBaseColor)
|
||||
Component.grayFilter = -20,-70,100
|
||||
|
||||
Component.success.borderColor = desaturate($Component.success.focusedBorderColor,25%)
|
||||
Component.success.focusedBorderColor = #648b3c
|
||||
Component.error.borderColor = desaturate($Component.error.focusedBorderColor,25%)
|
||||
Component.error.focusedBorderColor = #8b3c3c
|
||||
Component.warning.borderColor = darken(desaturate($Component.warning.focusedBorderColor,20%),10%)
|
||||
|
||||
@@ -190,6 +190,8 @@ Component.linkColor = @accentLinkColor
|
||||
Component.accentColor = if(@accentColor, @accentColor, @accentBaseColor)
|
||||
Component.grayFilter = 25,-25,100
|
||||
|
||||
Component.success.borderColor = lighten(desaturate($Component.success.focusedBorderColor,20%),25%)
|
||||
Component.success.focusedBorderColor = #14dc92
|
||||
Component.error.borderColor = lighten(desaturate($Component.error.focusedBorderColor,20%),25%)
|
||||
Component.error.focusedBorderColor = #e53e4d
|
||||
Component.warning.borderColor = lighten(saturate($Component.warning.focusedBorderColor,25%),20%)
|
||||
|
||||
Reference in New Issue
Block a user