mirror of
https://gitee.com/energye/energy.git
synced 2024-11-29 18:28:06 +08:00
demos: 无标题和边框窗口示例
This commit is contained in:
parent
7e232bd459
commit
1a5a2725df
@ -14,7 +14,7 @@ import (
|
||||
"github.com/energye/energy/cef"
|
||||
"github.com/energye/energy/common/assetserve"
|
||||
"github.com/energye/energy/ipc"
|
||||
"runtime"
|
||||
"github.com/energye/golcl/lcl/rtl/version"
|
||||
)
|
||||
|
||||
//go:embed resources
|
||||
@ -34,6 +34,7 @@ func main() {
|
||||
cef.BrowserWindow.Config.IconFS = "resources/icon.png"
|
||||
cef.BrowserWindow.Config.EnableHideCaption = true
|
||||
cef.BrowserWindow.Config.Title = "Energy Vue + ElementUI 示例"
|
||||
cef.BrowserWindow.Config.Width = 1200
|
||||
chromiumConfig := cef.BrowserWindow.Config.ChromiumConfig()
|
||||
chromiumConfig.SetEnableMenu(false) //禁用右键菜单
|
||||
|
||||
@ -56,11 +57,8 @@ func main() {
|
||||
bw.CloseBrowserWindow()
|
||||
})
|
||||
event.On("os-info", func(context ipc.IIPCContext) {
|
||||
goos := runtime.GOOS
|
||||
arch := runtime.GOARCH
|
||||
result := fmt.Sprintf("%v-%v", goos, arch)
|
||||
fmt.Println("系统信息", result)
|
||||
context.Result().SetString(result)
|
||||
fmt.Println("系统信息", version.OSVersion.ToString())
|
||||
context.Result().SetString(version.OSVersion.ToString())
|
||||
})
|
||||
})
|
||||
cef.BrowserWindow.SetBrowserInit(func(event *cef.BrowserEvent, window cef.IBrowserWindow) {
|
||||
|
@ -61,9 +61,9 @@
|
||||
|
||||
<el-container>
|
||||
<el-header style="font-size: 12px;-webkit-app-region: drag;">
|
||||
<div style="width: 450px;float: left;">
|
||||
<div style="width: 650px;float: left;">
|
||||
<div style="float: left"><img src="icon.png" style="margin-top: 10px;" height="40"/></div>
|
||||
<div style="font-size: 14px;font-weight: bold;">窗口标题栏 VUE + ElementUI <span style="color: green;"> {{osInfo}}</span>
|
||||
<div style="font-size: 12px;font-weight: bold;">窗口标题栏 VUE + ElementUI <span style="color: green;"> {{osInfo}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div style="text-align: right;">
|
||||
|
Loading…
Reference in New Issue
Block a user