add DPI Scaling setting

This commit is contained in:
josc146
2023-06-20 22:22:14 +08:00
parent ce915cdf6a
commit 285e8b1577
7 changed files with 77 additions and 8 deletions

View File

@@ -2,6 +2,7 @@ package backend_golang
import (
"context"
"errors"
"net/http"
"os"
"os/exec"
@@ -14,9 +15,11 @@ import (
// App struct
type App struct {
ctx context.Context
exDir string
cmdPrefix string
ctx context.Context
HasConfigData bool
ConfigData map[string]any
exDir string
cmdPrefix string
}
// NewApp creates a new App application struct
@@ -64,6 +67,19 @@ func (a *App) UpdateApp(url string) (broken bool, err error) {
return false, nil
}
func (a *App) RestartApp() error {
if runtime.GOOS == "windows" {
name, err := os.Executable()
if err != nil {
return err
}
exec.Command(name, os.Args[1:]...).Start()
wruntime.Quit(a.ctx)
return nil
}
return errors.New("unsupported OS")
}
func (a *App) GetPlatform() string {
return runtime.GOOS
}