New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for manually closing PopupWindows #2810
Conversation
I'd like to see if this is acceptable. If it is, then I can try to add a test for it to get at least code coverage for the generators. I tested it locally :-) |
a91bd91
to
51a7657
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should still close the popup when clicking outside of the popup or not?
Maybe there should be several flags, or some enum?
If we don't close the popup when clicking outside, how can a user do that if they want to?
To me that's starting to sound like a But we can extend |
4a15390
to
806e03d
Compare
This patch adds a `close()` function that can be called to close a popup window, and a `close-to-click` boolean that can be set to false to disable the default behavior.
Unfortunately in the CI the test runs with Qt, where send_mouse_click in the test will send the event to the main QWindow not the popup. We can't select the testing backend because it's not published and we can't make the nodejs crate depend on it for initialization.
806e03d
to
eeb64f0
Compare
It should be up to the developer to determine what the UX should be. In my case I would rather have a The HMI I am working on is going to be made available on tens of thousands of welding machines over time and these machines are going in to workshops where there is a combination of user types from tech-savy to computer illiterate. So with PopupWindow I have two usecases for it - a big notification, and a dropdown menu. For the big notification I could have a callback to the main window to show a Rectangle with text or similar, but I may also need to show widgets - and I'm unsure how to do that with callbacks since I can't pass widgets in a function. Whereas with a PopupWindow I have a bit more freedom to show some complex stuff when required. However for I'm certainly open to alternative ideas on how to achieve these things. Thanks for adding this capability BTW, it solves the issue I had with |
This patch adds a
close()
function that can be called to close a popup window, and aclose-to-click
boolean that can be set to false to disable the default behavior.