mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-04 07:29:56 +08:00
22 lines
628 B
Go
22 lines
628 B
Go
//go:build linux
|
|
|
|
package application
|
|
|
|
import "github.com/wailsapp/wails/v3/pkg/events"
|
|
|
|
var commonApplicationEventMap = map[events.ApplicationEventType]events.ApplicationEventType{
|
|
events.Linux.ApplicationStartup: events.Common.ApplicationStarted,
|
|
events.Linux.SystemThemeChanged: events.Common.ThemeChanged,
|
|
}
|
|
|
|
func (a *linuxApp) setupCommonEvents() {
|
|
for sourceEvent, targetEvent := range commonApplicationEventMap {
|
|
sourceEvent := sourceEvent
|
|
targetEvent := targetEvent
|
|
a.parent.OnApplicationEvent(sourceEvent, func(event *ApplicationEvent) {
|
|
event.Id = uint(targetEvent)
|
|
applicationEvents <- event
|
|
})
|
|
}
|
|
}
|