mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-04 02:02:55 +08:00
Remove OpenContextMenu
This commit is contained in:
parent
45195d5bd6
commit
54140e9adb
@ -1094,25 +1094,6 @@ func (w *WebviewWindow) HandleDragAndDropMessage(filenames []string) {
|
||||
}
|
||||
}
|
||||
|
||||
func (w *WebviewWindow) OpenContextMenu(data *ContextMenuData) {
|
||||
menu, ok := w.contextMenus[data.Id]
|
||||
if !ok {
|
||||
// try application level context menu
|
||||
menu, ok = globalApplication.getContextMenu(data.Id)
|
||||
if !ok {
|
||||
w.Error("No context menu found for id: %s", data.Id)
|
||||
return
|
||||
}
|
||||
}
|
||||
menu.setContextData(data)
|
||||
if w.impl == nil && !w.isDestroyed() {
|
||||
return
|
||||
}
|
||||
InvokeSync(func() {
|
||||
w.impl.openContextMenu(menu, data)
|
||||
})
|
||||
}
|
||||
|
||||
// RegisterContextMenu registers a context menu and assigns it the given name.
|
||||
func (w *WebviewWindow) RegisterContextMenu(name string, menu *Menu) {
|
||||
w.contextMenusLock.Lock()
|
||||
|
@ -44,7 +44,6 @@ type Window interface {
|
||||
Minimise() Window
|
||||
Name() string
|
||||
On(eventType events.WindowEventType, callback func(event *WindowEvent)) func()
|
||||
OpenContextMenu(data *ContextMenuData)
|
||||
RegisterContextMenu(name string, menu *Menu)
|
||||
RelativePosition() (int, int)
|
||||
Reload()
|
||||
|
Loading…
Reference in New Issue
Block a user