mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
widhet/material: change minimum Loader size to be a default
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -27,13 +27,13 @@ func Loader(th *Theme) LoaderStyle {
|
||||
}
|
||||
|
||||
func (l LoaderStyle) Layout(gtx layout.Context) layout.Dimensions {
|
||||
diam := gtx.Px(unit.Dp(24))
|
||||
if minX := gtx.Constraints.Min.X; minX > diam {
|
||||
diam = minX
|
||||
}
|
||||
diam := gtx.Constraints.Min.X
|
||||
if minY := gtx.Constraints.Min.Y; minY > diam {
|
||||
diam = minY
|
||||
}
|
||||
if diam == 0 {
|
||||
diam = gtx.Px(unit.Dp(24))
|
||||
}
|
||||
sz := gtx.Constraints.Constrain(image.Pt(diam, diam))
|
||||
radius := float64(sz.X) * .5
|
||||
defer op.Push(gtx.Ops).Pop()
|
||||
|
||||
Reference in New Issue
Block a user