mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-13 15:27:16 -06:00
Search/clear icons: fixed colors for some IntelliJ themes (e.g. "Dark Flat") that use translucent color for Actions.GreyInline
This commit is contained in:
@@ -902,21 +902,32 @@ class UIDefaultsLoader
|
|||||||
* Syntax: fade(color,amount[,options])
|
* Syntax: fade(color,amount[,options])
|
||||||
* - color: a color (e.g. #f00) or a color function
|
* - color: a color (e.g. #f00) or a color function
|
||||||
* - amount: percentage 0-100%
|
* - amount: percentage 0-100%
|
||||||
* - options: [derived]
|
* - options: [derived] [lazy]
|
||||||
*/
|
*/
|
||||||
private static Object parseColorFade( List<String> params, Function<String, String> resolver, boolean reportError ) {
|
private static Object parseColorFade( List<String> params, Function<String, String> resolver, boolean reportError ) {
|
||||||
String colorStr = params.get( 0 );
|
String colorStr = params.get( 0 );
|
||||||
int amount = parsePercentage( params.get( 1 ) );
|
int amount = parsePercentage( params.get( 1 ) );
|
||||||
boolean derived = false;
|
boolean derived = false;
|
||||||
|
boolean lazy = false;
|
||||||
|
|
||||||
if( params.size() > 2 ) {
|
if( params.size() > 2 ) {
|
||||||
String options = params.get( 2 );
|
String options = params.get( 2 );
|
||||||
derived = options.contains( "derived" );
|
derived = options.contains( "derived" );
|
||||||
|
lazy = options.contains( "lazy" );
|
||||||
}
|
}
|
||||||
|
|
||||||
// create function
|
// create function
|
||||||
ColorFunction function = new ColorFunctions.Fade( amount );
|
ColorFunction function = new ColorFunctions.Fade( amount );
|
||||||
|
|
||||||
|
if( lazy ) {
|
||||||
|
return (LazyValue) t -> {
|
||||||
|
Object color = lazyUIManagerGet( colorStr );
|
||||||
|
return (color instanceof Color)
|
||||||
|
? new ColorUIResource( ColorFunctions.applyFunctions( (Color) color, function ) )
|
||||||
|
: null;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
// parse base color, apply function and create derived color
|
// parse base color, apply function and create derived color
|
||||||
return parseFunctionBaseColor( colorStr, function, derived, resolver, reportError );
|
return parseFunctionBaseColor( colorStr, function, derived, resolver, reportError );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -589,13 +589,13 @@ ScrollPane.smoothScrolling = true
|
|||||||
|
|
||||||
#---- SearchField ----
|
#---- SearchField ----
|
||||||
|
|
||||||
SearchField.searchIconColor = fadeout(Actions.GreyInline,10%,lazy)
|
SearchField.searchIconColor = fade(Actions.GreyInline,90%,lazy)
|
||||||
SearchField.searchIconHoverColor = fadeout(Actions.GreyInline,30%,lazy)
|
SearchField.searchIconHoverColor = fade(Actions.GreyInline,70%,lazy)
|
||||||
SearchField.searchIconPressedColor = fadeout(Actions.GreyInline,50%,lazy)
|
SearchField.searchIconPressedColor = fade(Actions.GreyInline,50%,lazy)
|
||||||
|
|
||||||
SearchField.clearIconColor = fadeout(Actions.GreyInline,50%,lazy)
|
SearchField.clearIconColor = fade(Actions.GreyInline,50%,lazy)
|
||||||
SearchField.clearIconHoverColor = $SearchField.clearIconColor
|
SearchField.clearIconHoverColor = $SearchField.clearIconColor
|
||||||
SearchField.clearIconPressedColor = fadeout(Actions.GreyInline,20%,lazy)
|
SearchField.clearIconPressedColor = fade(Actions.GreyInline,80%,lazy)
|
||||||
|
|
||||||
|
|
||||||
#---- Separator ----
|
#---- Separator ----
|
||||||
|
|||||||
Reference in New Issue
Block a user