1 Star 2 Fork 0

vilan/vilan-peer

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
main.go 2.11 KB
一键复制 编辑 原始数据 按行查看 历史
huangli 提交于 2024-04-06 14:36 +08:00 . 首次提交
package main
import (
"embed"
"fmt"
"github.com/wailsapp/wails/v2"
"github.com/wailsapp/wails/v2/pkg/logger"
"github.com/wailsapp/wails/v2/pkg/options"
"github.com/wailsapp/wails/v2/pkg/options/assetserver"
"github.com/wailsapp/wails/v2/pkg/options/mac"
"github.com/wailsapp/wails/v2/pkg/options/windows"
"log"
"runtime"
"runtime/debug"
"vilan/app"
"vilan/common"
)
//go:embed frontend/dist
var assets embed.FS
func main() {
fmt.Println("当前程序版本:", app.Version)
debug.SetMemoryLimit(1024 * 1024 * 50)
version := common.GetSystemVersion()
// Create an instance of the wailsApp structure
wailsApp := NewWailsApp()
app.WailsApp = wailsApp
serialApp := NewSerialApp()
// Create application with options
//goland:noinspection GoBoolExpressions
err := wails.Run(&options.App{
Title: "Vilan客户端",
Width: 900,
Height: 600,
MinWidth: 760,
MinHeight: 570,
DisableResize: true,
Fullscreen: false,
Frameless: runtime.GOOS != "darwin",
StartHidden: false,
HideWindowOnClose: false,
BackgroundColour: &options.RGBA{R: 255, G: 255, B: 255, A: 255},
AssetServer: &assetserver.Options{
Assets: assets,
},
LogLevel: logger.WARNING,
OnStartup: wailsApp.startup,
OnDomReady: wailsApp.domReady,
OnBeforeClose: wailsApp.beforeClose,
OnShutdown: wailsApp.shutdown,
/*
MaxWidth: 1920,
MaxHeight: 1280,
*/
Bind: []interface{}{
wailsApp,
serialApp,
},
// Windows platform specific options
Windows: &windows.Options{
WebviewIsTransparent: true,
WindowIsTranslucent: version > 7, // win7 不支持
DisableWindowIcon: true,
WebviewBrowserPath: "",
},
Mac: &mac.Options{
TitleBar: &mac.TitleBar{
TitlebarAppearsTransparent: true,
HideTitle: true,
HideTitleBar: false,
FullSizeContent: false,
UseToolbar: false,
HideToolbarSeparator: true,
},
WebviewIsTransparent: true,
WindowIsTranslucent: true,
},
})
if err != nil {
log.Fatal(err)
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/net_vilan/vilan-peer.git
[email protected]:net_vilan/vilan-peer.git
net_vilan
vilan-peer
vilan-peer
master

搜索帮助