wailsapp / wails

Create beautiful applications using Go
https://wails.io
MIT License
25.18k stars 1.21k forks source link

[v3 feature] Add support for MacOS Panels (PR ready) #3760

Open nixpare opened 1 month ago

nixpare commented 1 month ago

Is your feature request related to a problem? Please describe.

No response

Describe the solution you'd like

The idea is to have a component like WebviewWindow (i called it WebviewPanel) which automatically inherits every functionality of WebviewWindow and behaves like a floating window / overlay (depending on the OS).

Describe alternatives you've considered

I have found a solution which uses Go's struct embedding to extend WebviewWindow so that there is no need to touch the objective-c bindings or care about porting any change made on WebviewWindow to WebviewPanel. This is true also for the WindowOptions. However my implementation, for now, supports only MacOS NSPanel.

My implementation was first created from version v3.0.0-alpha.6, and after the v3.0.0-alpha.7 new version, I have already made a merge with the new changes. The repo is at https://github.com/nixpare/wails/tree/v3-alpha-feature/mac-panel.

You can test a working example from my repo https://github.com/nixpare/wails-mac-panel, the PR version of wails is already vendored in the code, so just wails3 dev is needed.

Additional context

Important notes on changes i made:

Additional small bugs encountered and fixes:

leaanthony commented 1 month ago

This sounds amazing and the changes seem reasonable. Feel free to open a PR and we can discuss details on that. Amazing work! 🙏

nixpare commented 1 month ago

PR opened! Let me know if I can be of any help in any way