mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-03 08:25:34 +00:00
widget/material: allow configuring default typeface on theme
This commit introduces the material.Theme.Face field, which will automatically populate the Font.Typeface in every text widget created using a constructor function in package material. Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
This commit is contained in:
@@ -51,7 +51,7 @@ type IconButtonStyle struct {
|
||||
}
|
||||
|
||||
func Button(th *Theme, button *widget.Clickable, txt string) ButtonStyle {
|
||||
return ButtonStyle{
|
||||
b := ButtonStyle{
|
||||
Text: txt,
|
||||
Color: th.Palette.ContrastFg,
|
||||
CornerRadius: 4,
|
||||
@@ -64,6 +64,8 @@ func Button(th *Theme, button *widget.Clickable, txt string) ButtonStyle {
|
||||
Button: button,
|
||||
shaper: th.Shaper,
|
||||
}
|
||||
b.Font.Typeface = th.Face
|
||||
return b
|
||||
}
|
||||
|
||||
func ButtonLayout(th *Theme, button *widget.Clickable) ButtonLayoutStyle {
|
||||
|
||||
Reference in New Issue
Block a user