mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-04 08:55:35 +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:
@@ -14,7 +14,7 @@ type CheckBoxStyle struct {
|
||||
}
|
||||
|
||||
func CheckBox(th *Theme, checkBox *widget.Bool, label string) CheckBoxStyle {
|
||||
return CheckBoxStyle{
|
||||
c := CheckBoxStyle{
|
||||
CheckBox: checkBox,
|
||||
checkable: checkable{
|
||||
Label: label,
|
||||
@@ -27,6 +27,8 @@ func CheckBox(th *Theme, checkBox *widget.Bool, label string) CheckBoxStyle {
|
||||
uncheckedStateIcon: th.Icon.CheckBoxUnchecked,
|
||||
},
|
||||
}
|
||||
c.checkable.Font.Typeface = th.Face
|
||||
return c
|
||||
}
|
||||
|
||||
// Layout updates the checkBox and displays it.
|
||||
|
||||
Reference in New Issue
Block a user