1 Star 1 Fork 0

BlockShip/Chat-GUI

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
main.go 2.43 KB
Copy Edit Raw Blame History
BlockShip authored 2024-04-26 22:19 . update project
package main
import (
"chat_project/backend"
"embed"
"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/linux"
"github.com/wailsapp/wails/v2/pkg/options/mac"
"github.com/wailsapp/wails/v2/pkg/options/windows"
)
//go:embed all:frontend/dist
var assets embed.FS
func main() {
// Create an instance of the app structure
app := backend.NewApp()
// Create application with options
err := wails.Run(&options.App{
Title: "HongDouChat",
Width: 1280,
Height: 1000,
MinWidth: 1024,
MinHeight: 768,
MaxWidth: 2560,
MaxHeight: 1440,
AssetServer: &assetserver.Options{
Assets: assets,
},
BackgroundColour: &options.RGBA{R: 255, G: 0, B: 0, A: 128},
OnStartup: app.Startup,
OnShutdown: app.Shutdown,
OnDomReady: app.DomReady,
LogLevel: logger.DEBUG,
LogLevelProduction: logger.ERROR,
WindowStartState: options.Normal,
Bind: []interface{}{
app,
},
Windows: &windows.Options{
// WebviewIsTransparent: true,
// WindowIsTranslucent: false,
// DisableWindowIcon: false,
// DisableFramelessWindowDecorations: false,
// WebviewUserDataPath: "",
// WebviewBrowserPath: "",
Theme: windows.SystemDefault,
CustomTheme: &windows.ThemeSettings{
DarkModeTitleBar: windows.RGB(20, 20, 20),
DarkModeTitleText: windows.RGB(200, 200, 200),
DarkModeBorder: windows.RGB(20, 0, 20),
LightModeTitleBar: windows.RGB(200, 200, 200),
LightModeTitleText: windows.RGB(20, 20, 20),
LightModeBorder: windows.RGB(200, 200, 200),
},
},
// Mac platform specific options
Mac: &mac.Options{
TitleBar: &mac.TitleBar{
TitlebarAppearsTransparent: false,
HideTitle: true,
HideTitleBar: false,
FullSizeContent: false,
UseToolbar: false,
HideToolbarSeparator: true,
},
Appearance: mac.DefaultAppearance,
WebviewIsTransparent: true,
WindowIsTranslucent: true,
About: &mac.AboutInfo{
Title: "dedao gui downloader",
Message: "https://github.com/yann0917/dedao-gui",
//Icon: icon,
},
},
Linux: &linux.Options{
//Icon: icon,
},
})
if err != nil {
println("Error:", err.Error())
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/morning-ljn/chat-gui.git
git@gitee.com:morning-ljn/chat-gui.git
morning-ljn
chat-gui
Chat-GUI
master

Search