From c12909068601fab40540edba271de3c452bb66b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E7=BA=A2=E5=B2=A9?= Date: Mon, 12 Aug 2024 15:10:38 +0800 Subject: [PATCH] U: drag window, Control window resizing --- examples/popup-sub-window/popup_sub_window.go | 9 +++++++-- examples/popup-sub-window/resources/elliptic.html | 6 +++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/examples/popup-sub-window/popup_sub_window.go b/examples/popup-sub-window/popup_sub_window.go index d2a5a5b4..73f49fb0 100644 --- a/examples/popup-sub-window/popup_sub_window.go +++ b/examples/popup-sub-window/popup_sub_window.go @@ -12,6 +12,7 @@ import ( "github.com/energye/energy/v2/pkgs/assetserve" "github.com/energye/energy/v2/types" "github.com/energye/golcl/lcl" + lclTypes "github.com/energye/golcl/lcl/types" "strings" ) @@ -94,6 +95,7 @@ func main() { if strings.Index(beforePopupInfo.TargetUrl, "popup_1") > 0 { popupWindow.SetSize(800, 600) popupWindow.HideTitle() + popupWindow.WindowProperty().EnableResize = false } else if strings.Index(beforePopupInfo.TargetUrl, "popup_2") > 0 { popupWindow.SetSize(300, 300) popupWindow.HideTitle() @@ -102,8 +104,11 @@ func main() { popupWindow.WindowProperty().EnableWebkitAppRegionDClk = false window.RunOnMainThread(func() { popupWindow.SetSize(550, 550) - popupWindow.HideTitle() - popupWindow.Chromium().Config().SetEnableMenu(false) + //popupWindow.HideTitle() + if popupWindow.IsLCL() { + popupWindow.AsLCLBrowserWindow().BrowserWindow().SetBorderStyle(lclTypes.BsNone) + } + //popupWindow.Chromium().Config().SetEnableMenu(false) // 如果使用winapi方式改变窗口,需要在主线程中运行 elliptic(popupWindow) }) diff --git a/examples/popup-sub-window/resources/elliptic.html b/examples/popup-sub-window/resources/elliptic.html index 6becfb86..c2411c17 100644 --- a/examples/popup-sub-window/resources/elliptic.html +++ b/examples/popup-sub-window/resources/elliptic.html @@ -154,10 +154,10 @@ - + -
-