mirror of
https://gitee.com/energye/energy.git
synced 2024-12-03 12:17:44 +08:00
U: 禁用主窗口配置, 系统托盘创建的父组件修改
This commit is contained in:
parent
506fc0dfed
commit
7a6bb8acd7
@ -1112,9 +1112,10 @@ func (m *LCLBrowserWindow) closeQuery(sender lcl.IObject, close *bool) {
|
|||||||
ret = m.onCloseQuery(sender, close)
|
ret = m.onCloseQuery(sender, close)
|
||||||
}
|
}
|
||||||
if !ret {
|
if !ret {
|
||||||
if m.tray != nil {
|
// TODO 标记,可能需要移除
|
||||||
m.tray.close()
|
//if m.tray != nil {
|
||||||
}
|
// m.tray.close()
|
||||||
|
//}
|
||||||
logger.Debug("window.onCloseQuery windowType:", m.WindowType())
|
logger.Debug("window.onCloseQuery windowType:", m.WindowType())
|
||||||
if IsDarwin() {
|
if IsDarwin() {
|
||||||
//main window close
|
//main window close
|
||||||
|
@ -8,14 +8,19 @@
|
|||||||
//
|
//
|
||||||
//----------------------------------------
|
//----------------------------------------
|
||||||
|
|
||||||
// CEF 扩展组件
|
// 扩展组件
|
||||||
|
|
||||||
package cef
|
package cef
|
||||||
|
|
||||||
// NewTray 适用于 windows linux macos 系统托盘
|
// NewTray 适用于 windows linux macos 系统托盘
|
||||||
func (m *LCLBrowserWindow) NewTray() ITray {
|
func (m *LCLBrowserWindow) NewTray() ITray {
|
||||||
if m.tray == nil {
|
if m.tray == nil {
|
||||||
m.tray = newTray(m.TForm)
|
if BrowserWindow.Config.EnableMainWindow {
|
||||||
|
m.tray = newTray(m.TForm)
|
||||||
|
} else {
|
||||||
|
// 禁用主窗口, 这时需要使用 disabledMainWindow, 因为它才是实际的主窗口
|
||||||
|
m.tray = newTray(disabledMainWindow.TForm)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return m.tray
|
return m.tray
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user