提交 78eca831 编写于 作者: yanghye's avatar yanghye

v2.2.11 Fixed Chinese input and gtk3 issues for linux packagin

上级 e8035774
......@@ -199,8 +199,8 @@ func (m *ICefWindow) GetClientAreaBoundsInScreen() (result TCefRect) {
return
}
func (m *ICefWindow) SetDraggableRegions(regionsCount int32, regions []TCefDraggableRegion) {
Proc(internale_ICEFWindow_SetDraggableRegions).Call(uintptr(m.instance), uintptr(regionsCount), uintptr(unsafe.Pointer(&regions[0])), uintptr(int32(len(regions))))
func (m *ICefWindow) SetDraggableRegions(regions []TCefDraggableRegion) {
Proc(internale_ICEFWindow_SetDraggableRegions).Call(uintptr(m.instance), uintptr(int32(len(regions))), uintptr(unsafe.Pointer(&regions[0])), uintptr(int32(len(regions))))
}
func (m *ICefWindow) GetWindowHandle() consts.TCefWindowHandle {
......
......@@ -189,9 +189,13 @@ type TCefPoint struct {
Y int32
}
type TCefDraggableRegions struct {
regions []TCefDraggableRegion
}
type TCefDraggableRegion struct {
Bounds TCefRect
Draggable int32
Draggable bool
}
type ICefDisplay struct {
......@@ -210,6 +214,27 @@ type ICefClient struct {
instance unsafe.Pointer
}
func NewCefDraggableRegion(rect *TCefRect, draggable bool) TCefDraggableRegion {
return TCefDraggableRegion{
Bounds: *rect,
Draggable: draggable,
}
}
func NewCefDraggableRegions() *TCefDraggableRegions {
return &TCefDraggableRegions{
regions: make([]TCefDraggableRegion, 0),
}
}
func (m *TCefDraggableRegions) Regions() []TCefDraggableRegion {
return m.regions
}
func (m *TCefDraggableRegions) Append(region TCefDraggableRegion) {
m.regions = append(m.regions, region)
}
func NewCefRect(x, y, width, height int32) *TCefRect {
return &TCefRect{
X: x,
......
......@@ -67,6 +67,11 @@ func NewViewsFrameworkBrowserWindow(chromiumConfig *tCefChromiumConfig, windowPr
_ = m.windowComponent.SetWindowAppIcon(1, windowProperty.Icon)
}
m.browserViewComponent.RequestFocus()
regions := NewCefDraggableRegions()
regions.Append(NewCefDraggableRegion(NewCefRect(0, 0, 600, 600), true))
regions.Append(NewCefDraggableRegion(NewCefRect(0, 0, 100, 50), false))
window.SetDraggableRegions(regions.Regions())
m.windowComponent.Show()
if m.doOnWindowCreated != nil {
m.doOnWindowCreated(sender, window)
......
......@@ -88,8 +88,8 @@ func (m *TCEFWindowComponent) CancelMenu() {
Proc(internale_CEFWindowComponent_CancelMenu).Call(uintptr(m.instance))
}
func (m *TCEFWindowComponent) SetDraggableRegions(regionsCount int32, regions []TCefDraggableRegion) {
Proc(internale_CEFWindowComponent_SetDraggableRegions).Call(uintptr(m.instance), uintptr(regionsCount), uintptr(unsafe.Pointer(&regions[0])), uintptr(int32(len(regions))))
func (m *TCEFWindowComponent) SetDraggableRegions(regions []TCefDraggableRegion) {
Proc(internale_CEFWindowComponent_SetDraggableRegions).Call(uintptr(m.instance), uintptr(int32(len(regions))), uintptr(unsafe.Pointer(&regions[0])), uintptr(int32(len(regions))))
}
func (m *TCEFWindowComponent) SendKeyPress(keyCode int32, eventFlags uint32) {
......
......@@ -4,14 +4,17 @@
<meta charset="UTF-8">
<title>cookie</title>
<style>
</style>
<script type="application/javascript">
</script>
</head>
<body style="overflow: hidden;margin: 0px;padding: 0px;">
<a href="https://www.baidu.com" target="_blank">百度</a>
<a href="/" target="_blank">index</a>
<a href="https://energy.yanghy.cn">Energy</a>
<body style="overflow: hidden;margin: 0px;padding: 0px; ">
<div style="width: 600px;height: 600px;-webkit-app-region: drag;border: 1px solid red;">
<a href="https://www.baidu.com" target="_blank" style="-webkit-app-region: no-drag">百度</a>
<a href="/" target="_blank">index</a>
<a href="https://energy.yanghy.cn">Energy</a>
</div>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册