Skip to content

Commit

Permalink
U: drag window, Control window resizing
Browse files Browse the repository at this point in the history
  • Loading branch information
sxmxta committed Aug 12, 2024
1 parent cd89d5a commit c129090
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
9 changes: 7 additions & 2 deletions examples/popup-sub-window/popup_sub_window.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down Expand Up @@ -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()
Expand All @@ -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)
})
Expand Down
6 changes: 3 additions & 3 deletions examples/popup-sub-window/resources/elliptic.html
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,10 @@
</script>
</head>

<body style="-webkit-app-region: drag;--webkit-app-region: drag;">
<body style="-webkit-app-region: drag;">

<div class="clock" style="-webkit-app-region: drag;--webkit-app-region: drag;">
<ul class="mark">
<div class="clock" style="-webkit-app-region: drag;">
<ul class="mark" style="-webkit-app-region: drag;">
<script>
{
let i = 0;
Expand Down

0 comments on commit c129090

Please sign in to comment.