forked from mbk-lab/rui_orig
Optimisation
This commit is contained in:
parent
62910bf41f
commit
d1b30c56da
|
@ -112,7 +112,7 @@ ul:focus {
|
||||||
}
|
}
|
||||||
|
|
||||||
.ruiImageView {
|
.ruiImageView {
|
||||||
display: grid;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ruiSvgImageView {
|
.ruiSvgImageView {
|
||||||
|
|
|
@ -67,8 +67,7 @@ func newImageView(session Session) View {
|
||||||
func (imageView *imageViewData) init(session Session) {
|
func (imageView *imageViewData) init(session Session) {
|
||||||
imageView.viewData.init(session)
|
imageView.viewData.init(session)
|
||||||
imageView.tag = "ImageView"
|
imageView.tag = "ImageView"
|
||||||
//imageView.systemClass = "ruiImageView"
|
imageView.systemClass = "ruiImageView"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (imageView *imageViewData) String() string {
|
func (imageView *imageViewData) String() string {
|
||||||
|
|
23
theme.go
23
theme.go
|
@ -525,19 +525,38 @@ func (theme *theme) cssText(session Session) string {
|
||||||
var builder cssStyleBuilder
|
var builder cssStyleBuilder
|
||||||
builder.init()
|
builder.init()
|
||||||
|
|
||||||
for tag, style := range theme.styles {
|
styleList := func(styles map[string]ViewStyle) []string {
|
||||||
|
ruiStyles := []string{}
|
||||||
|
customStyles := []string{}
|
||||||
|
for tag, _ := range styles {
|
||||||
|
if strings.HasPrefix(tag, "rui") {
|
||||||
|
ruiStyles = append(ruiStyles, tag)
|
||||||
|
} else {
|
||||||
|
customStyles = append(customStyles, tag)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sort.Strings(ruiStyles)
|
||||||
|
sort.Strings(customStyles)
|
||||||
|
return append(ruiStyles, customStyles...)
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, tag := range styleList(theme.styles) {
|
||||||
|
if style := theme.styles[tag]; style != nil {
|
||||||
builder.startStyle(tag)
|
builder.startStyle(tag)
|
||||||
style.cssViewStyle(&builder, session)
|
style.cssViewStyle(&builder, session)
|
||||||
builder.endStyle()
|
builder.endStyle()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for _, media := range theme.mediaStyles {
|
for _, media := range theme.mediaStyles {
|
||||||
builder.startMedia(media.cssText())
|
builder.startMedia(media.cssText())
|
||||||
for tag, style := range media.styles {
|
for _, tag := range styleList(media.styles) {
|
||||||
|
if style := media.styles[tag]; style != nil {
|
||||||
builder.startStyle(tag)
|
builder.startStyle(tag)
|
||||||
style.cssViewStyle(&builder, session)
|
style.cssViewStyle(&builder, session)
|
||||||
builder.endStyle()
|
builder.endStyle()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
builder.endMedia()
|
builder.endMedia()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue