forked from mbk-lab/rui_orig
Update theme.go
This commit is contained in:
parent
1cf0ee0bae
commit
3bf3b9c2ba
10
theme.go
10
theme.go
|
@ -150,7 +150,7 @@ func parseMediaRule(text string) (mediaStyle, bool) {
|
||||||
}
|
}
|
||||||
rule.maxHeight = size
|
rule.maxHeight = size
|
||||||
} else {
|
} else {
|
||||||
ErrorLogF(`Unknown elemnet "%s" in the style section name "%s"`, element, text)
|
ErrorLogF(`Unknown element "%s" in the style section name "%s"`, element, text)
|
||||||
return rule, false
|
return rule, false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -830,7 +830,7 @@ func (theme *theme) String() string {
|
||||||
writeConstants("constants", theme.constants)
|
writeConstants("constants", theme.constants)
|
||||||
writeConstants("constants:touch", theme.touchConstants)
|
writeConstants("constants:touch", theme.touchConstants)
|
||||||
|
|
||||||
writeStyles := func(orientation, maxWidth, maxHeihgt int, styles map[string]ViewStyle) bool {
|
writeStyles := func(orientation, maxWidth, maxHeight int, styles map[string]ViewStyle) bool {
|
||||||
count := len(styles)
|
count := len(styles)
|
||||||
if count == 0 {
|
if count == 0 {
|
||||||
return false
|
return false
|
||||||
|
@ -853,8 +853,8 @@ func (theme *theme) String() string {
|
||||||
if maxWidth > 0 {
|
if maxWidth > 0 {
|
||||||
buffer.WriteString(fmt.Sprintf(":width%d", maxWidth))
|
buffer.WriteString(fmt.Sprintf(":width%d", maxWidth))
|
||||||
}
|
}
|
||||||
if maxHeihgt > 0 {
|
if maxHeight > 0 {
|
||||||
buffer.WriteString(fmt.Sprintf(":heihgt%d", maxHeihgt))
|
buffer.WriteString(fmt.Sprintf(":height%d", maxHeight))
|
||||||
}
|
}
|
||||||
buffer.WriteString(" = [\n")
|
buffer.WriteString(" = [\n")
|
||||||
|
|
||||||
|
@ -862,7 +862,7 @@ func (theme *theme) String() string {
|
||||||
if style, ok := styles[tag]; ok {
|
if style, ok := styles[tag]; ok {
|
||||||
buffer.WriteString("\t\t")
|
buffer.WriteString("\t\t")
|
||||||
writeViewStyle(tag, style, buffer, "\t\t")
|
writeViewStyle(tag, style, buffer, "\t\t")
|
||||||
buffer.WriteString(",")
|
buffer.WriteString(",\n")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
buffer.WriteString("\t],\n")
|
buffer.WriteString("\t],\n")
|
||||||
|
|
Loading…
Reference in New Issue