Bug fixing

This commit is contained in:
Alexei Anoshenko 2024-06-19 16:36:50 +03:00
parent 27ebaf1bfe
commit d1d8c2af37
2 changed files with 18 additions and 7 deletions

15
view.go
View File

@ -790,14 +790,15 @@ func (view *viewData) addToCSSStyle(addCSS map[string]string) {
func (view *viewData) cssStyle(self View, builder cssBuilder) { func (view *viewData) cssStyle(self View, builder cssBuilder) {
view.viewStyle.cssViewStyle(builder, view.session) view.viewStyle.cssViewStyle(builder, view.session)
switch GetVisibility(view) { /*
case Invisible: switch GetVisibility(view) {
builder.add(`visibility`, `hidden`) case Invisible:
builder.add(`visibility`, `hidden`)
case Gone:
builder.add(`display`, `none`)
}
case Gone:
builder.add(`display`, `none`)
}
*/
if view.addCSS != nil { if view.addCSS != nil {
for tag, value := range view.addCSS { for tag, value := range view.addCSS {
builder.add(tag, value) builder.add(tag, value)

View File

@ -174,6 +174,16 @@ func (style *viewStyle) backgroundCSS(session Session) string {
func (style *viewStyle) cssViewStyle(builder cssBuilder, session Session) { func (style *viewStyle) cssViewStyle(builder cssBuilder, session Session) {
if visibility, ok := enumProperty(style, Visibility, session, Visible); ok {
switch visibility {
case Invisible:
builder.add(`visibility`, `hidden`)
case Gone:
builder.add(`display`, `none`)
}
}
if margin, ok := boundsProperty(style, Margin, session); ok { if margin, ok := boundsProperty(style, Margin, session); ok {
margin.cssValue(Margin, builder, session) margin.cssValue(Margin, builder, session)
} }