5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-04 23:41:38 +08:00
wails/v3/pkg/application/menuitem_dev.go
Lea Anthony e424a85a99
Menu improvements (#3492)
* Expose `DefaultApplicationMenu`.
Add `FindByLabel` and `ItemAt` for finding menu items in a menu

* Add `Menu.RemoveMenuItem()`, `MneuItem.GetAccelerator()` and `MenuItem.RemoveAccelerator()`

* Remove `Update`

* Iterate when removing menu items

* Add `GetSubmenu()`
2024-05-20 21:15:02 +10:00

15 lines
339 B
Go

//go:build !production || devtools
package application
func newOpenDevToolsMenuItem() *MenuItem {
return NewMenuItem("Open Developer Tools").
SetAccelerator("Alt+Command+I").
OnClick(func(ctx *Context) {
currentWindow := globalApplication.CurrentWindow()
if currentWindow != nil {
currentWindow.OpenDevTools()
}
})
}