Merge pull request #19 from anoshenko/feature/fix-theme-name

Fixed issue with theme "name" (de-)serialization.
This commit is contained in:
Alexei Anoshenko 2026-06-29 15:25:23 +03:00 committed by GitHub
commit d88c214d58
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 13 additions and 0 deletions

View File

@ -713,6 +713,12 @@ func (theme *theme) addText(themeText string) bool {
for d := range data.Properties() { for d := range data.Properties() {
switch tag := d.Tag(); tag { switch tag := d.Tag(); tag {
case "name":
if d.Type() == TextNode {
if text := d.Text(); text != "" {
theme.name = text
}
}
case "constants": case "constants":
if d.Type() == ObjectNode { if d.Type() == ObjectNode {
if obj := d.Object(); obj != nil { if obj := d.Object(); obj != nil {
@ -928,6 +934,13 @@ func (theme *theme) String() string {
} }
buffer.WriteString("theme {\n") buffer.WriteString("theme {\n")
if theme.name != "" {
buffer.WriteString("\tname = ")
writeString(theme.name)
buffer.WriteString(",\n")
}
writeConstants("colors", theme.colors) writeConstants("colors", theme.colors)
writeConstants("colors:dark", theme.darkColors) writeConstants("colors:dark", theme.darkColors)
writeConstants("images", theme.images) writeConstants("images", theme.images)