Open merlindru opened 1 year ago
Hey thanks for opening this. There's already some window state methods available in the runtime library but I think we could do better here. Fancy a stab at it? 😅
Yes! @leaanthony However, I can't let my frontend know when the window state changed with what's currently available in the runtime, right?
I want to change the state of my maximize button depending on whether the window is currently maximized or not:
Window is maximised
Window is normal
This is useful not only for frameless app's title bars, but for changing layout depending on the window state. My app can't know whether it's been maximised after the initial load without polling WindowIsMaximised
I want to change the state of my maximize button depending on whether the window is currently maximized or not:
Window is maximised
Window is normal
this could easily be achieved by adding an event listener on the resize event for the window and check for the window state after and update the UI accordingly.
Is your feature request related to a problem? Please describe.
https://github.com/wailsapp/wails/pull/1349
Describe the solution you'd like
Hi y'all! I want to track the WindowState in react, but it seems there is no event for it?
I tried
EventsOn(":wails:window:maximised")
like in the PR, andEventsOn(":wails:WindowIsMaximised")
but neither of them fire when the WindowState changes.On a side note: Is there any documentation for the events from the wails runtime? If not, do we need some? Where can I find these events? (CTRL+F
:wails:
I assume :P)Describe alternatives you've considered
No response
Additional context
No response