5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-09 18:31:29 +08:00

[linux/purego] updates

This commit is contained in:
Travis McLane 2023-05-02 11:43:28 -05:00
parent a485b188b3
commit ba34e47c4b
2 changed files with 16 additions and 7 deletions

View File

@ -377,7 +377,7 @@ func newMinimizeMenuItem() *MenuItem {
OnClick(func(ctx *Context) {
currentWindow := globalApplication.CurrentWindow()
if currentWindow != nil {
currentWindow.Minimize()
currentWindow.Minimise()
}
})
}

View File

@ -664,11 +664,7 @@ func (w *linuxWebviewWindow) setTransparent() {
}
}
func (w *linuxWebviewWindow) setBackgroundColour(colour *RGBA) {
if colour == nil {
return
}
func (w *linuxWebviewWindow) setBackgroundColour(colour RGBA) {
if colour.Alpha != 0 {
w.setTransparent()
}
@ -717,10 +713,23 @@ func (w *linuxWebviewWindow) destroy() {
}
func (w *linuxWebviewWindow) setHTML(html string) {
fmt.Println("setHTML")
var loadHTML func(uintptr, string, string, *string)
purego.RegisterLibFunc(&loadHTML, webkit, "webkit_web_view_load_alternate_html")
go globalApplication.dispatchOnMainThread(func() {
loadHTML(w.webview, html, "wails://", nil)
})
}
func (w *linuxWebviewWindow) isNormal() bool {
return !w.isMinimised() && !w.isMaximised() && !w.isFullscreen()
}
func (w *linuxWebviewWindow) isVisible() bool {
var isVisible func(uintptr) bool
purego.RegisterLibFunc(&isVisible, gtk, "gtk_widget_is_visible")
return isVisible(w.window)
}
func (w *linuxWebviewWindow) nativeWindowHandle() uintptr {
return w.window
}