mirror of
https://gitee.com/energye/energy.git
synced 2024-12-02 03:37:48 +08:00
46 lines
1.0 KiB
Go
46 lines
1.0 KiB
Go
//----------------------------------------
|
|
//
|
|
// Copyright © yanghy. All Rights Reserved.
|
|
//
|
|
// Licensed under Apache License Version 2.0, January 2004
|
|
//
|
|
// https://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
//----------------------------------------
|
|
|
|
// 扩展组件
|
|
|
|
package cef
|
|
|
|
// NewTray 适用于 windows linux macos 系统托盘
|
|
func (m *LCLBrowserWindow) NewTray() ITray {
|
|
if m.tray == nil {
|
|
if BrowserWindow.Config.EnableMainWindow {
|
|
m.tray = newTray(m.TForm)
|
|
} else {
|
|
// 禁用主窗口, 这时需要使用 disabledMainWindow, 因为它才是实际的主窗口
|
|
m.tray = newTray(disabledMainWindow.TForm)
|
|
}
|
|
}
|
|
return m.tray
|
|
}
|
|
|
|
// NewSysTray LCL窗口组件,系统托盘
|
|
func (m *LCLBrowserWindow) NewSysTray() ITray {
|
|
if m.tray == nil {
|
|
m.tray = newSysTray()
|
|
}
|
|
return m.tray
|
|
}
|
|
|
|
// NewSysTray VF窗口组件,只适用于windows的无菜单托盘
|
|
func (m *ViewsFrameworkBrowserWindow) NewSysTray() ITray {
|
|
if m == nil {
|
|
return nil
|
|
}
|
|
if m.tray == nil {
|
|
m.tray = newSysTray()
|
|
}
|
|
return m.tray
|
|
}
|