Resize main screen headers

This commit is contained in:
Trevor Slocum 2024-11-19 00:05:38 -08:00
parent f33edf763a
commit c7defb1896
4 changed files with 12 additions and 12 deletions

View file

@ -38,7 +38,7 @@ import (
)
const (
AppVersion = "v1.4.6"
AppVersion = "v1.4.6p1"
baseButtonHeight = 54
MaxDebug = 2
DefaultServerAddress = "wss://ws.bgammon.org:1338"
@ -797,6 +797,8 @@ func (g *Game) initialize() {
g.selectConnect()
return false
})}
centerInput(g.connectServer)
g.connectServer.SetAutoResize(true)
g.mainStatusGrid = etk.NewGrid()
g.mainStatusGrid.AddChildAt(statusBuffer, 0, 0, 1, 1)
@ -835,13 +837,13 @@ func (g *Game) initialize() {
f.SetMaxWidth(1024)
wgt = f
}
headerHeight := etk.Scale(60)
headerHeight := fieldHeight
headerLabel := newCenteredText(header)
headerLabel.SetAutoResize(true)
infoLabel := newCenteredText(info)
infoLabel.SetVertical(etk.AlignStart)
infoLabel.SetAutoResize(false)
if smallScreen {
headerHeight = etk.Scale(20)
headerLabel.SetHorizontal(etk.AlignCenter)
headerLabel.SetFont(etk.Style.TextFont, etk.Scale(largeFontSize))
infoLabel.SetFont(etk.Style.TextFont, etk.Scale(largeFontSize))
@ -986,7 +988,6 @@ func (g *Game) initialize() {
grid.AddChildAt(g.registerPassword, 2, 2, 2, 1)
y := 3
if ShowServerSettings {
centerInput(g.connectServer)
grid.AddChildAt(serverLabel, 1, y, 2, 1)
grid.AddChildAt(g.connectServer, 2, y, 2, 1)
y++
@ -1042,7 +1043,6 @@ func (g *Game) initialize() {
grid.AddChildAt(g.resetEmail, 2, 0, 2, 1)
y := 1
if ShowServerSettings {
centerInput(g.connectServer)
grid.AddChildAt(serverLabel, 1, y, 2, 1)
grid.AddChildAt(g.connectServer, 2, y, 2, 1)
y++
@ -1111,7 +1111,6 @@ func (g *Game) initialize() {
grid.AddChildAt(g.connectPassword, 2, 1, 2, 1)
g.connectGridY = 2
if ShowServerSettings {
centerInput(g.connectServer)
grid.AddChildAt(serverLabel, 1, g.connectGridY, 2, 1)
grid.AddChildAt(g.connectServer, 2, g.connectGridY, 2, 1)
g.connectGridY++

2
go.mod
View file

@ -7,7 +7,7 @@ toolchain go1.23.0
require (
code.rocket9labs.com/tslocum/bgammon v0.0.0-20241119003936-1ea81e724209
code.rocket9labs.com/tslocum/bgammon-bei-bot v0.0.0-20240917031657-2648772e515e
code.rocket9labs.com/tslocum/etk v0.0.0-20241117014653-8eb4115081a5
code.rocket9labs.com/tslocum/etk v0.0.0-20241119080430-53b248a771f0
code.rocket9labs.com/tslocum/gotext v0.0.0-20240728181248-46f419ff143b
code.rocket9labs.com/tslocum/tabula v0.0.0-20241024013344-d112a9463c51
github.com/coder/websocket v1.8.12

4
go.sum
View file

@ -6,8 +6,8 @@ code.rocket9labs.com/tslocum/bgammon-bei-bot v0.0.0-20240917031657-2648772e515e
code.rocket9labs.com/tslocum/bgammon-bei-bot v0.0.0-20240917031657-2648772e515e/go.mod h1:mZA8T+w1qkH5tzFfDQb87wCms+qlulyT9Q8deuK1ApQ=
code.rocket9labs.com/tslocum/clipboard v0.0.0-20241012025701-2c0fb515daab h1:0sF/YYnb3/GaPMKALyNVXS0Ku5JoulpC4GWdTcP1v+Q=
code.rocket9labs.com/tslocum/clipboard v0.0.0-20241012025701-2c0fb515daab/go.mod h1:v2cql+mNoahFvZ1U/KQmDDqPmD0H0l1jyistVAgg8YA=
code.rocket9labs.com/tslocum/etk v0.0.0-20241117014653-8eb4115081a5 h1:sXMZdkIdVK6hXGFGyYFa3u51/dBf6TkS77rjRA4PhlA=
code.rocket9labs.com/tslocum/etk v0.0.0-20241117014653-8eb4115081a5/go.mod h1:Vx+vyYrAVVbPrrHUg570gfdFSdDOqQIZzREf/FNVKt8=
code.rocket9labs.com/tslocum/etk v0.0.0-20241119080430-53b248a771f0 h1:JQyEdyNaBOQbCIxnx+gOC7a3uC0CZZbMJqsTxAq1nhM=
code.rocket9labs.com/tslocum/etk v0.0.0-20241119080430-53b248a771f0/go.mod h1:Vx+vyYrAVVbPrrHUg570gfdFSdDOqQIZzREf/FNVKt8=
code.rocket9labs.com/tslocum/gotext v0.0.0-20240728181248-46f419ff143b h1:KSdR7VPoftY5Bt+osGRBbtHlCWxhe1QbOuf58CG7ieI=
code.rocket9labs.com/tslocum/gotext v0.0.0-20240728181248-46f419ff143b/go.mod h1:ZkYZ/IF/ebzhUL2bNp4ALROsuH9iCztUWvUJBWsHXRU=
code.rocket9labs.com/tslocum/tabula v0.0.0-20241024013344-d112a9463c51 h1:JkjRKoSSmtHFSVIOAZV6e+Z+7r0mIxClsDpJxC/ZlOs=

View file

@ -10,6 +10,7 @@ import (
"syscall"
"code.rocket9labs.com/tslocum/boxcars/game"
"code.rocket9labs.com/tslocum/gotext"
"github.com/hajimehoshi/ebiten/v2"
)
@ -19,13 +20,13 @@ const (
)
func main() {
ebiten.SetWindowTitle("bgammon.org - Free Online Backgammon")
g := parseFlags()
ebiten.SetWindowTitle(gotext.Get("%s - Free Online Backgammon", "bgammon.org"))
ebiten.SetWindowSize(screenWidth, screenHeight)
ebiten.SetWindowResizingMode(ebiten.WindowResizingModeEnabled)
ebiten.SetWindowIcon([]image.Image{game.ImgIconAlt})
g := parseFlags()
sigc := make(chan os.Signal, 1)
signal.Notify(sigc,
syscall.SIGINT,