make width height configurable

This commit is contained in:
aynakeya
2024-04-10 00:52:59 -07:00
parent 084050fcf7
commit d52f97429d
4 changed files with 11 additions and 5 deletions

View File

@@ -4,7 +4,7 @@ import (
"AynaLivePlayer/core/events"
"AynaLivePlayer/core/model"
"AynaLivePlayer/global"
config2 "AynaLivePlayer/pkg/config"
"AynaLivePlayer/pkg/config"
"AynaLivePlayer/pkg/event"
"AynaLivePlayer/pkg/i18n"
"AynaLivePlayer/resource"
@@ -36,7 +36,7 @@ func Initialize() {
//os.Setenv("FYNE_FONT", config.GetAssetPath("msyh.ttc"))
App = app.New()
App.Settings().SetTheme(&myTheme{})
MainWindow = App.NewWindow(fmt.Sprintf("%s Ver %s", config2.ProgramName, model.Version(config2.Version)))
MainWindow = App.NewWindow(fmt.Sprintf("%s Ver %s", config.ProgramName, model.Version(config.Version)))
tabs := container.NewAppTabs(
container.NewTabItem(i18n.T("gui.tab.player"),
@@ -63,7 +63,7 @@ func Initialize() {
MainWindow.SetIcon(resource.ImageIcon)
MainWindow.SetContent(tabs)
//MainWindow.Resize(fyne.NewSize(1280, 720))
MainWindow.Resize(fyne.NewSize(960, 480))
MainWindow.Resize(fyne.NewSize(config.General.Width, config.General.Height))
setupPlayerWindow()
@@ -78,7 +78,7 @@ func Initialize() {
dialog.ShowError(err, MainWindow)
})
//MainWindow.SetFixedSize(true)
MainWindow.SetFixedSize(true)
//if config2.General.AutoCheckUpdate {
// go checkUpdate()
//}

View File

@@ -1,6 +1,8 @@
package internal
import (
_ "github.com/AynaLivePlayer/miaosic/providers/bilibili"
_ "github.com/AynaLivePlayer/miaosic/providers/bilivideo"
_ "github.com/AynaLivePlayer/miaosic/providers/kuwo"
_ "github.com/AynaLivePlayer/miaosic/providers/netease"
)

View File

@@ -10,7 +10,7 @@ import (
const (
ProgramName = "卡西米尔唱片机"
Version uint32 = 0x00090b
Version uint32 = 0x010000
)
const (

View File

@@ -2,6 +2,8 @@ package config
type _GeneralConfig struct {
BaseConfig
Width float32
Height float32
Language string
AutoCheckUpdate bool
}
@@ -13,4 +15,6 @@ func (c *_GeneralConfig) Name() string {
var General = &_GeneralConfig{
Language: "zh-CN",
AutoCheckUpdate: true,
Width: 960,
Height: 480,
}