U: Optimize and remove unnecessary code

This commit is contained in:
杨红岩 2024-09-24 10:19:30 +08:00
parent e5a13b385c
commit e403f89afd
6 changed files with 4 additions and 67 deletions

View File

@ -14,7 +14,9 @@
package cef
func (m *LCLBrowserWindow) _HookWndProcMessage() {
// no impl
}
func (m *LCLBrowserWindow) _RestoreWndProc() {
// no impl
}

View File

@ -60,7 +60,6 @@ func (m *LCLBrowserWindow) wndProc(hwnd types.HWND, message uint32, wParam, lPar
}
}
//return uintptr(winapi.CallWindowProc(types.TFarProc(m.oldWndPrc), hwnd, types.UINT(message), types.WPARAM(wParam), types.LPARAM(lParam)))
return win.CallWindowProc(m.oldWndPrc, uintptr(hwnd), message, wParam, lParam)
}

View File

@ -192,7 +192,6 @@ func (m *LCLBrowserWindow) SetProperty() {
m.SetFormStyle(types.FsSystemStayOnTop)
}
if wp.EnableHideCaption {
//m.HideTitle()
m.frameless()
} else {
if !wp.EnableMinimize {

View File

@ -21,7 +21,7 @@ import (
)
func (m *LCLBrowserWindow) frameless() {
// no impl
}
func (m *LCLBrowserWindow) SetRoundRectRgn(rgn int) {

View File

@ -22,22 +22,8 @@ import (
"github.com/energye/golcl/lcl/win"
)
// 定义四角和边框范围
var (
angleRange int32 = 10 //四角
borderRange int32 = 5 //四边框
)
// 组件消息类型
type compMessageType int8
const (
cmtCEF compMessageType = iota
cmtLCL
)
func (m *LCLBrowserWindow) frameless() {
// no impl
}
// SetRoundRectRgn 窗口无边框时圆角设置

View File

@ -13,7 +13,6 @@
package cef
import (
"github.com/energye/energy/v2/common"
. "github.com/energye/energy/v2/consts"
)
@ -38,51 +37,3 @@ func acceleratorCode(shift, ctrl, alt bool, keyCode rune) string {
}
return accelerator
}
var defaultAcceleratorCustom = func() {
//macos 下快捷键
if common.IsDarwin() {
KeyAccelerator.AddAcceleratorCustom(&AcceleratorCustom{
Accelerator: "ctrl+a",
Callback: func(browse *ICefBrowser, event *TCefKeyEvent, result *bool) {
browse.GetFocusedFrame().SelectAll()
*result = true
},
})
KeyAccelerator.AddAcceleratorCustom(&AcceleratorCustom{
Accelerator: "ctrl+x",
Callback: func(browse *ICefBrowser, event *TCefKeyEvent, result *bool) {
browse.GetFocusedFrame().Cut()
*result = true
},
})
KeyAccelerator.AddAcceleratorCustom(&AcceleratorCustom{
Accelerator: "ctrl+c",
Callback: func(browse *ICefBrowser, event *TCefKeyEvent, result *bool) {
browse.GetFocusedFrame().Copy()
*result = true
},
})
KeyAccelerator.AddAcceleratorCustom(&AcceleratorCustom{
Accelerator: "ctrl+v",
Callback: func(browse *ICefBrowser, event *TCefKeyEvent, result *bool) {
browse.GetFocusedFrame().Paste()
*result = true
},
})
KeyAccelerator.AddAcceleratorCustom(&AcceleratorCustom{
Accelerator: "ctrl+z",
Callback: func(browse *ICefBrowser, event *TCefKeyEvent, result *bool) {
browse.GetFocusedFrame().Undo()
*result = true
},
})
KeyAccelerator.AddAcceleratorCustom(&AcceleratorCustom{
Accelerator: "ctrl+shift+z",
Callback: func(browse *ICefBrowser, event *TCefKeyEvent, result *bool) {
browse.GetFocusedFrame().Redo()
*result = true
},
})
}
}