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
zhangli10 committed Aug 12, 2024
1 parent c129090 commit 4160bdc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
10 changes: 8 additions & 2 deletions cef/browser_window_lcl_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func (m *PlatformWindow) SetBackgroundColor(red, green, blue, alpha uint8) {
}

func (m *PlatformWindow) Init() {
C.init()
//C.init()
}

func (m *LCLBrowserWindow) PlatformWindow() *PlatformWindow {
Expand All @@ -112,7 +112,13 @@ func (m *LCLBrowserWindow) frameless() {
nsWindow := m.PlatformWindow()
nsWindow.SetTitleBarAppearsTransparent(true)
nsWindow.SetTitleVisibility(types.NSWindowTitleHidden)
nsWindow.SetStyleMask(NSWindowStyleMaskClosable | NSWindowStyleMaskMiniaturizable | NSWindowStyleMaskResizable)
mask := uint(NSWindowStyleMaskClosable | NSWindowStyleMaskMiniaturizable | NSWindowStyleMaskResizable)
wp := m.WindowProperty()
if !wp.EnableResize {
mask ^= NSWindowStyleMaskResizable
}
nsWindow.SetStyleMask(mask)

C.setFrameless(nsWindow.Instance())
}

Expand Down
3 changes: 2 additions & 1 deletion examples/frameless/frameless.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ func main() {

//指定一个URL地址,或本地html文件目录
cef.BrowserWindow.Config.Url = "http://localhost:22022/index.html"
//cef.BrowserWindow.Config.EnableHideCaption = true
cef.BrowserWindow.Config.EnableHideCaption = true
//cef.BrowserWindow.Config.EnableResize = false
cef.BrowserWindow.Config.Title = "Energy Vue + ElementUI 示例"
cef.BrowserWindow.Config.Width = 1200
cef.BrowserWindow.Config.Height = 600
Expand Down

0 comments on commit 4160bdc

Please sign in to comment.