5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-07 05:42:31 +08:00
wails/v3/pkg/application/events_common_windows.go
Lea Anthony 3d88bf8795
Fix context menu issues.
Fix WindowID for requests on windows.
Add `Windows.ApplicationStarted` event
2023-10-10 21:48:47 +11:00

22 lines
609 B
Go

//go:build windows
package application
import "github.com/wailsapp/wails/v3/pkg/events"
var commonApplicationEventMap = map[events.ApplicationEventType]events.ApplicationEventType{
events.Windows.SystemThemeChanged: events.Common.ThemeChanged,
events.Windows.ApplicationStarted: events.Common.ApplicationStarted,
}
func (m *windowsApp) setupCommonEvents() {
for sourceEvent, targetEvent := range commonApplicationEventMap {
sourceEvent := sourceEvent
targetEvent := targetEvent
m.parent.On(sourceEvent, func(event *Event) {
event.Id = uint(targetEvent)
applicationEvents <- event
})
}
}