From 0a94f6844c89f65fe2d9904623248605ccfee186 Mon Sep 17 00:00:00 2001 From: Drew Weymouth Date: Sat, 4 Mar 2023 15:16:39 -0800 Subject: [PATCH] update app titlebar --- main.go | 7 ++++--- ui/mainwindow.go | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index f2b5cb9..cd43792 100644 --- a/main.go +++ b/main.go @@ -14,8 +14,9 @@ import ( ) const ( - appname = "supersonic" - configFile = "config.toml" + appname = "supersonic" + displayName = "Supersonic" + configFile = "config.toml" ) func configPath() string { @@ -38,7 +39,7 @@ func main() { if h <= 1 { h = 800 } - mainWindow := ui.NewMainWindow(fyneApp, appname, myApp, fyne.NewSize(w, h)) + mainWindow := ui.NewMainWindow(fyneApp, displayName, myApp, fyne.NewSize(w, h)) // TODO: There is some race condition with running this initial startup // task immediately before showing and running the window/Fyne main loop where diff --git a/ui/mainwindow.go b/ui/mainwindow.go index 2ffe157..e617d41 100644 --- a/ui/mainwindow.go +++ b/ui/mainwindow.go @@ -1,6 +1,7 @@ package ui import ( + "fmt" "supersonic/backend" "supersonic/res" "supersonic/ui/browsing" @@ -70,7 +71,7 @@ func NewMainWindow(fyneApp fyne.App, appName string, app *backend.App, size fyne m.Window.SetTitle(appName) return } - m.Window.SetTitle(song.Title) + m.Window.SetTitle(fmt.Sprintf("%s – %s · %s", song.Title, song.Artist, appName)) }) app.ServerManager.OnServerConnected(func() { m.BrowsingPane.EnableNavigationButtons()