[v3 windows] Support Close and take into account HideOnClose option

This commit is contained in:
Lea Anthony
2023-06-03 15:23:10 +10:00
parent ba4ffe4ecc
commit 6092730acc
3 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ Webview Window Interface Methods
| Method | Windows | Linux | Mac | Notes |
|----------------------------------------------------|---------|-------|-----|------------------------------------------|
| center() | Y | | Y | |
| close() | | | Y | |
| close() | Y | | Y | |
| destroy() | | | Y | |
| execJS(js string) | Y | | Y | |
| focus() | Y | | Y | |
+4
View File
@@ -590,6 +590,10 @@ func (w *WebviewWindow) Close() {
if w.impl == nil {
return
}
if w.options.HideOnClose {
invokeSync(func() { w.Hide() })
return
}
invokeSync(w.impl.close)
}
+1 -2
View File
@@ -351,8 +351,7 @@ func (w *windowsWebviewWindow) setZoom(zoom float64) {
}
func (w *windowsWebviewWindow) close() {
//TODO implement me
panic("implement me")
w32.SendMessage(w.hwnd, w32.WM_CLOSE, 0, 0)
}
func (w *windowsWebviewWindow) zoom() {