设置icon

This commit is contained in:
wh_zcy 2022-08-11 10:42:41 +08:00
parent 8c158797c6
commit 0aba7a3fef
4 changed files with 33 additions and 1 deletions

BIN
cmd/v2/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

View File

@ -5,6 +5,7 @@ import (
"go_dreamfactory/cmd/v2/lib/common" "go_dreamfactory/cmd/v2/lib/common"
"go_dreamfactory/cmd/v2/service" "go_dreamfactory/cmd/v2/service"
"go_dreamfactory/cmd/v2/service/observer" "go_dreamfactory/cmd/v2/service/observer"
"go_dreamfactory/cmd/v2/theme"
"go_dreamfactory/cmd/v2/ui" "go_dreamfactory/cmd/v2/ui"
"io" "io"
"os" "os"
@ -51,7 +52,9 @@ func main() {
logrus.Info("Starting...") logrus.Info("Starting...")
// create a new ui // create a new ui
appUI := ui.NewUI(app.NewWithID("protocol-test-tool"), configService, connService, pttService, obs) app := app.NewWithID("protocol-test-tool")
app.SetIcon(theme.ResourceIconPng)
appUI := ui.NewUI(app, configService, connService, pttService, obs)
mainWindow := ui.NewMainWindow(appUI) mainWindow := ui.NewMainWindow(appUI)
mainWindow.CreateWindow(common.APP_NAME, 1366, 768, true) mainWindow.CreateWindow(common.APP_NAME, 1366, 768, true)

View File

@ -11,6 +11,23 @@ fyne bundle msyh.ttc >> bundled.go
fyne bundle -append msyhbd.ttc >> bundled.go fyne bundle -append msyhbd.ttc >> bundled.go
(不要使用powershell 或vscode自带终端) (不要使用powershell 或vscode自带终端)
## icon
1.
将静态资源编译为 go 文件
fyne bundle fav.png >> bundled.go
如果是要追加资源
fyne bundle -append image2.jpg >> bundled.go
2.
a := app.New()
a.SetIcon(resourceFavPng)
## package
fyne package -os windows -icon icon.png
## 开发协议参数表单 ## 开发协议参数表单
1. 1.

12
cmd/v2/theme/icon.go Normal file

File diff suppressed because one or more lines are too long