This commit is contained in:
Mahdi Abu Yasmine 2023-11-04 18:31:36 +01:00
parent bd0bb96234
commit ee8f40814e

View File

@ -82,11 +82,20 @@ func NewStyles() *Styles {
return l return l
} }
func (s *Styles) HasStyle(name string) bool {
var done bool = false
for key := range s.List {
if done = key == name; done {
break
}
}
return done
}
func (s *Styles) Get(name string) *Style { func (s *Styles) Get(name string) *Style {
var style *Style style := defStyle
var ok bool = false if s.HasStyle(name) {
if style, ok = s.List[name]; !ok { style = s.List[name]
style = defStyle
} }
return style return style
} }