refactor(gioui): move common button code to two functions

This commit is contained in:
vsariola
2021-04-20 18:21:21 +03:00
parent c0a0a5d501
commit e544e955cb
5 changed files with 28 additions and 34 deletions

View File

@ -18,3 +18,19 @@ func IconButton(th *material.Theme, w *widget.Clickable, icon []byte, enabled bo
}
return ret
}
func LowEmphasisButton(th *material.Theme, w *widget.Clickable, text string) material.ButtonStyle {
ret := material.Button(th, w, text)
ret.Color = th.Palette.Fg
ret.Background = transparent
ret.Inset = layout.UniformInset(unit.Dp(6))
return ret
}
func HighEmphasisButton(th *material.Theme, w *widget.Clickable, text string) material.ButtonStyle {
ret := material.Button(th, w, text)
ret.Color = th.Palette.ContrastFg
ret.Background = th.Palette.Fg
ret.Inset = layout.UniformInset(unit.Dp(6))
return ret
}