mirror of
https://github.com/vsariola/sointu.git
synced 2025-07-18 21:14:31 -04:00
refactor(gioui): move common button code to two functions
This commit is contained in:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user