Added versions numbers and display on titlebar

This commit is contained in:
2024-10-01 15:53:57 -04:00
parent 9b28f2fb0a
commit 30c48dcf9b
4 changed files with 24 additions and 3 deletions

8
app.go
View File

@ -2,11 +2,17 @@ package main
import (
"context"
_ "embed"
"github.com/wailsapp/wails/v2/pkg/options"
"github.com/wailsapp/wails/v2/pkg/runtime"
"strings"
"github.com/tidwall/gjson"
)
//go:embed wails.json
var wailsJSON string
var wailsContext *context.Context
// App struct
@ -22,7 +28,9 @@ func NewApp() *App {
// startup is called when the app starts. The context is saved
// so we can call the runtime methods
func (a *App) startup(ctx context.Context) {
version := gjson.Get(wailsJSON, "info.productVersion")
wailsContext = &ctx
runtime.WindowSetTitle(ctx, "AniTrack "+version.String())
//runtime.WindowMaximise(ctx)
}