mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-09 08:15:09 +03:00
Styling: fixed detection of value type if key prefix ix given (e.g. [light]padding)
This commit is contained in:
@@ -114,6 +114,7 @@ public class FlatStyleSupport
|
||||
String key = e.getKey();
|
||||
Object newValue = e.getValue();
|
||||
|
||||
// handle key prefix
|
||||
if( key.startsWith( "[" ) ) {
|
||||
if( (SystemInfo.isWindows && key.startsWith( "[win]" )) ||
|
||||
(SystemInfo.isMacOS && key.startsWith( "[mac]" )) ||
|
||||
@@ -182,6 +183,11 @@ public class FlatStyleSupport
|
||||
if( value.startsWith( "$" ) )
|
||||
return UIManager.get( value.substring( 1 ) );
|
||||
|
||||
// remove key prefix for correct value type detection
|
||||
// (e.g. "[light]padding" would not parse to Insets)
|
||||
if( key.startsWith( "[" ) )
|
||||
key = key.substring( key.indexOf( ']' ) + 1 );
|
||||
|
||||
return FlatLaf.parseDefaultsValue( key, value );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user