From ee963b2772d6416fae9a11ffe7414b3e7eda7301 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Tue, 22 Jul 2025 16:16:13 -0400 Subject: present reset button on top of prompt --- go/client/game.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'go/client') diff --git a/go/client/game.go b/go/client/game.go index 19677ea5..5718371b 100644 --- a/go/client/game.go +++ b/go/client/game.go @@ -96,7 +96,7 @@ func newGame(app *app, gameState game.State) *Game { g.resetButton = ui.NewRoundSimpleButton( 10, - g.Height/2+DEFAULT_BUTTON_HEIGHT/2, + g.Height/2, DEFAULT_BUTTON_HEIGHT, "X", func(*ui.SimpleButton) { @@ -395,10 +395,13 @@ func (g *Game) declareAction(a game.Action) { g.stateBar.ForceRedraw() } -// show a widget by adding it to the collection +// show ensures a widget is visible by adding it to the collection or moving it to the last position. func (g *Game) show(w ui.Widget) { - if g.FindWidget(w) == -1 { + idx := g.FindWidget(w) + if idx == -1 { g.AddWidget(w) + } else { + g.MoveIdxToLast(idx) } } -- cgit v1.2.3