Added versions numbers and display on titlebar
This commit is contained in:
8
app.go
8
app.go
@ -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)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user