mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-06 14:00:55 +03:00
UIDefaultsLoader: detect string values, that start and end with '"', after determining value type from key to allow font values like "Roboto Mono"
This commit is contained in:
@@ -410,10 +410,7 @@ class UIDefaultsLoader
|
|||||||
// check whether value type is specified in the value
|
// check whether value type is specified in the value
|
||||||
if( value.startsWith( "#" ) )
|
if( value.startsWith( "#" ) )
|
||||||
valueType = ValueType.COLOR;
|
valueType = ValueType.COLOR;
|
||||||
else if( value.startsWith( "\"" ) && value.indexOf( '"', 1 ) == value.length() - 1 ) {
|
else if( value.startsWith( TYPE_PREFIX ) ) {
|
||||||
valueType = ValueType.STRING;
|
|
||||||
value = value.substring( 1, value.length() - 1 );
|
|
||||||
} else if( value.startsWith( TYPE_PREFIX ) ) {
|
|
||||||
int end = value.indexOf( TYPE_PREFIX_END );
|
int end = value.indexOf( TYPE_PREFIX_END );
|
||||||
if( end != -1 ) {
|
if( end != -1 ) {
|
||||||
try {
|
try {
|
||||||
@@ -482,6 +479,12 @@ class UIDefaultsLoader
|
|||||||
case GRAYFILTER: return parseGrayFilter( value );
|
case GRAYFILTER: return parseGrayFilter( value );
|
||||||
case UNKNOWN:
|
case UNKNOWN:
|
||||||
default:
|
default:
|
||||||
|
// string
|
||||||
|
if( value.startsWith( "\"" ) && value.endsWith( "\"" ) ) {
|
||||||
|
resultValueType[0] = ValueType.STRING;
|
||||||
|
return value.substring( 1, value.length() - 1 );
|
||||||
|
}
|
||||||
|
|
||||||
// colors
|
// colors
|
||||||
Object color = parseColorOrFunction( value, resolver, false );
|
Object color = parseColorOrFunction( value, resolver, false );
|
||||||
if( color != null ) {
|
if( color != null ) {
|
||||||
|
|||||||
Reference in New Issue
Block a user