Skip to content

Commit

Permalink
splash: fix dialog size calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
apprehensions committed Feb 9, 2024
1 parent 0e8d67f commit 34cfc05
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions splash/dialog.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 34cfc05

Please sign in to comment.