From 34cfc0526fd184ba35a96fffa362f0f232e8e244 Mon Sep 17 00:00:00 2001 From: sewn Date: Fri, 9 Feb 2024 09:46:02 +0300 Subject: [PATCH] splash: fix dialog size calculation --- splash/dialog.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/splash/dialog.go b/splash/dialog.go index 86a01b1..6c01b6b 100644 --- a/splash/dialog.go +++ b/splash/dialog.go @@ -42,18 +42,20 @@ func (ui *Splash) Dialog(txt string, user bool) (r bool) { } width := 384 + // DOES NOT ACCOUNT FOR SCALING FACTORS + // PLZ FIX GIO height := func() int { l := material.Body2(th, txt) gtx := layout.Context{ Ops: &ops, Constraints: layout.Constraints{ - Min: image.Point{X: 64, Y: 38}, - Max: image.Point{X: width, Y: width * 2}, + Min: image.Point{X: width, Y: 0}, + Max: image.Point{X: width, Y: width * 4}, }, } defer ops.Reset() - return l.Layout(gtx).Size.Y + (18 * 4) + return l.Layout(gtx).Size.Y + (18 * 2) + 57 + 4 }() w := window(unit.Dp(width), unit.Dp(height))