Closed leaanthony closed 2 months ago
The changes encompass a comprehensive refactoring of the event handling mechanisms across multiple files in the application. Key modifications include the introduction of more specific event types, such as ApplicationEvent
and CustomEvent
, and the renaming of event listener methods to enhance clarity. The updates aim to streamline event registration and processing, improving the overall structure and organization of the event management system.
Files | Change Summary |
---|---|
v3/examples/build/main.go , v3/examples/video/main.go , v3/examples/hide-window/main.go |
Updated event listener registration from app.On to app.OnApplicationEvent , changing parameter types from *application.Event to *application.ApplicationEvent . |
v3/examples/drag-n-drop/main.go , v3/examples/events/main.go , v3/examples/window/main.go |
Renamed event listener methods to more specific names, e.g., OnWindowEvent , and changed event parameter types to enhance specificity and clarity in event handling. |
v3/examples/events/assets/index.html |
Added a new event listener for "windowevent" to append data to an HTML element, duplicating existing functionality. |
v3/examples/plain/main.go , v3/examples/wml/main.go |
Shifted event handling from app.Events.On to app.customEventProcessor.On , changing parameter types from *application.WailsEvent to *application.CustomEvent . |
v3/pkg/application/application.go , v3/pkg/application/events.go |
Renamed Event type to ApplicationEvent and WailsEvent to CustomEvent , updated associated methods and structures to reflect the new event types. |
v3/pkg/application/systemtray_windows.go , v3/pkg/application/webview_window.go |
Modified event listener methods to use OnApplicationEvent and updated parameter types to ApplicationEvent , enhancing clarity in event handling. |
v3/pkg/application/messageprocessor_events.go , v3/pkg/application/systemtray.go |
Changed event handling logic to utilize CustomEvent and customEventProcessor for emitting events, indicating a refined event management approach. |
v3/pkg/application/webview_window_windows.go |
Renamed event handling methods for clarity and updated comments to standardize formatting. |
sequenceDiagram
participant User
participant App
participant EventProcessor
User->>App: Trigger Event
App->>EventProcessor: Register Event
EventProcessor->>App: Emit Event
App->>User: Respond to Event
π° "In the meadow, hopping free,
Events now flow with clarity!
Custom types and names so bright,
Make my code a pure delight!
With every click and every cheer,
A rabbit's joy is surely near!" π
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
Description
After a review of how events work in v3, it was decided to change the API to be more in line with v2.
Summary by CodeRabbit
New Features
WebviewWindow
struct.Improvements
On
toOnApplicationEvent
andOnWindowEvent
.Bug Fixes