mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-14 07:47:12 -06: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();
|
String key = e.getKey();
|
||||||
Object newValue = e.getValue();
|
Object newValue = e.getValue();
|
||||||
|
|
||||||
|
// handle key prefix
|
||||||
if( key.startsWith( "[" ) ) {
|
if( key.startsWith( "[" ) ) {
|
||||||
if( (SystemInfo.isWindows && key.startsWith( "[win]" )) ||
|
if( (SystemInfo.isWindows && key.startsWith( "[win]" )) ||
|
||||||
(SystemInfo.isMacOS && key.startsWith( "[mac]" )) ||
|
(SystemInfo.isMacOS && key.startsWith( "[mac]" )) ||
|
||||||
@@ -182,6 +183,11 @@ public class FlatStyleSupport
|
|||||||
if( value.startsWith( "$" ) )
|
if( value.startsWith( "$" ) )
|
||||||
return UIManager.get( value.substring( 1 ) );
|
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 );
|
return FlatLaf.parseDefaultsValue( key, value );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user