Fixed issue with theme "name" (de-)serialization.

This commit is contained in:
Mikalai Turankou 2026-06-29 15:02:49 +03:00
parent 0c1bdce7c8
commit 14b0300b26
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)