diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatStyleSupport.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatStyleSupport.java index 902f79b3..2108c077 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatStyleSupport.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatStyleSupport.java @@ -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 ); }