Added menu cloning.

Introduced the ability to clone a menu, along with its submenus, in Linux-based web applications to create a full deep copy. This fixes reusing the application menu for window menus.
This commit is contained in:
Lea Anthony
2024-03-06 15:40:28 -06:00
committed by Travis McLane
parent 758c4c2c8d
commit a048233f4c
2 changed files with 3 additions and 26 deletions
+1 -9
View File
@@ -37,14 +37,6 @@ type linuxWebviewWindow struct {
gtkmenu pointer
}
func (w *linuxWebviewWindow) setMinimiseButtonEnabled(enabled bool) {
// Not available in Linux
}
func (w *linuxWebviewWindow) setMaximiseButtonEnabled(enabled bool) {
// Not available in Linux
}
var (
registered bool = false // avoid 'already registered message' about 'wails://'
)
@@ -276,7 +268,7 @@ func (w *linuxWebviewWindow) run() {
w.gtkmenu = (menu.impl).(*linuxMenu).native
}
w.window, w.webview, w.vbox = windowNew(app.application, menu, w.parent.id, w.parent.options.Linux.WebviewGpuPolicy)
w.window, w.webview, w.vbox = windowNew(app.application, w.gtkmenu, w.parent.id, w.parent.options.Linux.WebviewGpuPolicy)
app.registerWindow(w.window, w.parent.id) // record our mapping
w.connectSignals()
if w.parent.options.EnableDragAndDrop {