mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-03 08:25:34 +00:00
text: make Shaper an interface
And rename out the caching implementation to FontRegistry. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -24,7 +24,7 @@ type Button struct {
|
||||
Font text.Font
|
||||
Background color.RGBA
|
||||
CornerRadius unit.Value
|
||||
shaper *text.Shaper
|
||||
shaper text.Shaper
|
||||
}
|
||||
|
||||
type IconButton struct {
|
||||
|
||||
@@ -20,7 +20,7 @@ type checkable struct {
|
||||
Font text.Font
|
||||
IconColor color.RGBA
|
||||
Size unit.Value
|
||||
shaper *text.Shaper
|
||||
shaper text.Shaper
|
||||
checkedStateIcon *Icon
|
||||
uncheckedStateIcon *Icon
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ type Editor struct {
|
||||
// HintColor is the color of hint text.
|
||||
HintColor color.RGBA
|
||||
|
||||
shaper *text.Shaper
|
||||
shaper text.Shaper
|
||||
}
|
||||
|
||||
func (t *Theme) Editor(hint string) Editor {
|
||||
|
||||
@@ -23,7 +23,7 @@ type Label struct {
|
||||
MaxLines int
|
||||
Text string
|
||||
|
||||
shaper *text.Shaper
|
||||
shaper text.Shaper
|
||||
}
|
||||
|
||||
func (t *Theme) H1(txt string) Label {
|
||||
|
||||
@@ -16,7 +16,7 @@ import (
|
||||
)
|
||||
|
||||
type Theme struct {
|
||||
Shaper *text.Shaper
|
||||
Shaper text.Shaper
|
||||
Color struct {
|
||||
Primary color.RGBA
|
||||
Text color.RGBA
|
||||
|
||||
Reference in New Issue
Block a user