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
}
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 {
var style *Style
var ok bool = false
if style, ok = s.List[name]; !ok {
style = defStyle
style := defStyle
if s.HasStyle(name) {
style = s.List[name]
}
return style
}