diff --git a/core/src/main/resources/com/github/weisj/darklaf/properties/icons/files.properties b/core/src/main/resources/com/github/weisj/darklaf/properties/icons/files.properties index c0fe71ec..81c3d493 100644 --- a/core/src/main/resources/com/github/weisj/darklaf/properties/icons/files.properties +++ b/core/src/main/resources/com/github/weisj/darklaf/properties/icons/files.properties @@ -24,5 +24,5 @@ # # suppress inspection "UnusedProperty" for whole file # -Icons.image.sky.color = %palette.teal -Icons.image.grass.color = %palette.green +Icons.image.sky.color = '%palette.teal' +Icons.image.grass.color = '%palette.green' diff --git a/core/src/main/resources/com/github/weisj/darklaf/properties/icons/frame.properties b/core/src/main/resources/com/github/weisj/darklaf/properties/icons/frame.properties index 64a6c069..315443ee 100644 --- a/core/src/main/resources/com/github/weisj/darklaf/properties/icons/frame.properties +++ b/core/src/main/resources/com/github/weisj/darklaf/properties/icons/frame.properties @@ -24,19 +24,19 @@ # # suppress inspection "UnusedProperty" for whole file # -Icons.windowClose.color = %windowButton -Icons.windowCloseHover.color = %windowCloseHovered -Icons.windowCloseInactive.color = %windowButtonDisabled +Icons.windowClose.color = '%windowButton' +Icons.windowCloseHover.color = '%windowCloseHovered' +Icons.windowCloseInactive.color = '%windowButtonDisabled' -Icons.windowHelp.color = %windowButton -Icons.windowHelpInactive.color = %windowButtonDisabled +Icons.windowHelp.color = '%windowButton' +Icons.windowHelpInactive.color = '%windowButtonDisabled' -Icons.windowMaximize.color = %windowButton -Icons.windowMaximizeInactive.color = %windowButtonDisabled +Icons.windowMaximize.color = '%windowButton' +Icons.windowMaximizeInactive.color = '%windowButtonDisabled' -Icons.windowMinimize.color = %windowButton -Icons.windowMinimizeInactive.color = %windowButtonDisabled +Icons.windowMinimize.color = '%windowButton' +Icons.windowMinimizeInactive.color = '%windowButtonDisabled' -Icons.windowRestore.color = %windowButton -Icons.windowRestoreInactive.color = %windowButtonDisabled +Icons.windowRestore.color = '%windowButton' +Icons.windowRestoreInactive.color = '%windowButtonDisabled' diff --git a/property-loader/src/main/java/com/github/weisj/darklaf/parser/ParserUtil.java b/property-loader/src/main/java/com/github/weisj/darklaf/parser/ParserUtil.java index 14c70824..caf60e04 100644 --- a/property-loader/src/main/java/com/github/weisj/darklaf/parser/ParserUtil.java +++ b/property-loader/src/main/java/com/github/weisj/darklaf/parser/ParserUtil.java @@ -53,6 +53,14 @@ final class ParserUtil implements Delimiters { return parser != null ? parser.parse(p, c) : p; } + static boolean startsWith(final ParseResult parseResult, final String prefix) { + return parseResult.value.startsWith(prefix); + } + + static boolean startsWith(final ParseResult parseResult, final char prefix) { + return parseResult.value.length() > 0 && parseResult.value.charAt(0) == prefix; + } + static boolean stripPrefixFromKey(final ParseResult parseResult, final String prefix) { if (parseResult.key.startsWith(prefix)) { parseResult.key = parseResult.key.substring(prefix.length()); @@ -62,7 +70,7 @@ final class ParserUtil implements Delimiters { } static boolean stripPrefixFromValue(final ParseResult parseResult, final String prefix) { - if (parseResult.value.startsWith(prefix)) { + if (startsWith(parseResult, prefix)) { parseResult.value = parseResult.value.substring(prefix.length()); return true; } diff --git a/property-loader/src/main/java/com/github/weisj/darklaf/parser/PrimitiveParser.java b/property-loader/src/main/java/com/github/weisj/darklaf/parser/PrimitiveParser.java index 7a53adaf..b111c212 100644 --- a/property-loader/src/main/java/com/github/weisj/darklaf/parser/PrimitiveParser.java +++ b/property-loader/src/main/java/com/github/weisj/darklaf/parser/PrimitiveParser.java @@ -30,6 +30,7 @@ import com.github.weisj.darklaf.util.PropertyValue; public class PrimitiveParser implements PropertyParser { public static final String COLOR_PREFIX = "#"; + public static final char STRING_DELIMITER = '\''; @Override public ParseResult doParse(final ParseResult parseResult, final ParserContext context) { @@ -45,6 +46,13 @@ public class PrimitiveParser implements PropertyParser { } } if (parseResult.finished) return parseResult; + if (ParserUtil.startsWith(parseResult, STRING_DELIMITER)) { + ParserUtil.setNonNull(parseResult, + ParserUtil.parseBetween(STRING_DELIMITER, STRING_DELIMITER, + PropertyParser.of(String::valueOf), String.class, + parseResult, context).orElse(null)); + } + if (parseResult.finished) return parseResult; ParserUtil.setNonNull(parseResult, getInteger(parseResult.value)); if (parseResult.finished) return parseResult; ParserUtil.setNonNull(parseResult, getBoolean(parseResult.value));