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:
Chris Waldon
2023-06-22 15:06:22 -04:00
committed by Elias Naur
parent 6384ab6087
commit acab582487
6 changed files with 19 additions and 5 deletions
+3
View File
@@ -7,6 +7,7 @@ import (
"golang.org/x/exp/shiny/materialdesign/icons"
"gioui.org/font"
"gioui.org/text"
"gioui.org/unit"
"gioui.org/widget"
@@ -41,6 +42,8 @@ type Theme struct {
RadioChecked *widget.Icon
RadioUnchecked *widget.Icon
}
// Face selects the default typeface for text.
Face font.Typeface
// FingerSize is the minimum touch target size.
FingerSize unit.Dp