chore: client default size & dark theme backgroud

This commit is contained in:
IliaDenisov
2026-03-17 10:50:15 +02:00
parent 3f1776aa5f
commit 9208ef1065
2 changed files with 15 additions and 9 deletions
+13 -8
View File
@@ -69,16 +69,16 @@ type client struct {
hits []world.Hit
fullStorage storage.Storage
fullConnector connector.Connector
updater *updater.Manager
fullStorage storage.Storage
fullConnector connector.Connector
updater *updater.Manager
backgroundStop chan struct{}
backgroundOnce sync.Once
onConnectionFn func(bool)
onConnectionErrFn func(error)
onStorageErrFn func(error)
onServiceErrFn func(error)
onConnectionFn func(bool)
onConnectionErrFn func(error)
onStorageErrFn func(error)
onServiceErrFn func(error)
}
func NewClient(s storage.UIStorage, conn connector.UIConnector, app fyne.App) (mc.Client, error) {
@@ -192,6 +192,9 @@ func (e *client) BuildUI(w fyne.Window) {
}
func (e *client) loadWorld(w *world.World) {
if w == nil {
return
}
w.SetCircleRadiusScaleFp(world.SCALE / 4)
e.world = w
// TODO: store camera position in user settings
@@ -218,9 +221,11 @@ func (e *client) loadWorld(w *world.World) {
func (e *client) Run() error {
e.BuildUI(e.window)
e.window.SetMaster()
e.startBackground()
e.RequestRefresh()
e.window.SetMaster()
e.window.Resize(fyne.NewSize(800, 600))
e.window.CenterOnScreen()
e.window.ShowAndRun()
e.stopBackground()
return nil
+2 -1
View File
@@ -189,8 +189,9 @@ func (*DarkTheme) Name() string { return "Dark (Soft + Texture)" }
func (*DarkTheme) BackgroundColor() color.Color { return cRGBA(30, 32, 38, 255) } // #1E2026
func (t *DarkTheme) BackgroundImage() image.Image {
return nil
// This image is immutable after creation.
return t.bg
// return t.bg
}
func (*DarkTheme) BackgroundTileMode() BackgroundTileMode { return BackgroundTileRepeat }