@@ 1,7 1,5 @@
eliasnaur.com/font v0.0.0-20220215125817-de715634c840 h1:HovVBbKkUnf7OFR0qZy1PRB5CIabj+k5VRUDiIboM9c=
eliasnaur.com/font v0.0.0-20220215125817-de715634c840/go.mod h1:OYVuxibdk9OSLX8vAqydtRPP87PyTFcT9uH3MlEGBQA=
-gioui.org v0.0.0-20221216233230-5d1d1df2061c h1:5sweSGj5cjHLJgK4cGI5wNhghp/+JQF+MM0oen8HQA8=
-gioui.org v0.0.0-20221216233230-5d1d1df2061c/go.mod h1:3lLo7xMHYnnHTrgKNNctBjEKKH3wQCO2Sn7ti5Jy8mU=
gioui.org v0.0.0-20230101161950-e9bce02b24f0 h1:/3chuQ/TLkZ6SubTxxxOfO5FM1PUWVo0o/epk6PNe1o=
gioui.org v0.0.0-20230101161950-e9bce02b24f0/go.mod h1:3lLo7xMHYnnHTrgKNNctBjEKKH3wQCO2Sn7ti5Jy8mU=
gioui.org/cmd v0.0.0-20220818080936-02068d6340fc h1:KfVMY8YBF6OBlkw2WgCySAilfsyjtPtZaWaBAKSofo8=
@@ 5,7 5,6 @@ package main
import (
"gioui.org/app"
"gioui.org/layout"
- "gioui.org/unit"
"gioui.org/widget"
"gioui.org/widget/material"
)
@@ 45,13 44,12 @@ func (v *Letters) Layout(gtx layout.Context, th *material.Theme) layout.Dimensio
v.log.Printf("opening %s view", item.Text)
bigText := material.H1(th, item.Text)
- size := bigText.TextSize
- sizeDp := unit.Dp((float32(size) * 2 * gtx.Metric.PxPerSp) / gtx.Metric.PxPerDp)
+ size := 2 * gtx.Metric.SpToDp(bigText.TextSize)
v.App.NewWindow(item.Text,
WidgetView(func(gtx layout.Context, th *material.Theme) layout.Dimensions {
return layout.Center.Layout(gtx, material.H1(th, item.Text).Layout)
}),
- app.Size(sizeDp, sizeDp),
+ app.Size(size, size),
)
}
return material.Button(th, &item.Click, item.Text).Layout(gtx)