Add method for maximizing native application #2836
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Recently, while developing a local window program using NiceGUI, I found that I couldn't maximize the program. There is only one toggle_fullscreen method that can do something similar, but this method maximizes the interface program to cover the entire screen, not in the usual sense of maximization (Windows taskbar is not covered).
I learned from reviewing the source code that pywebview has a maximize method that can be used to correctly maximize the window, but this method is not implemented in NiceGUI's native.py. I added just two lines of code to mimic the minimize method to implement maximize, which allowed me to properly maximize the interface program through nicegui.
I'm not sure why the maximize method is missing from NiceGUI. Maybe it wasn't available in earlier versions of pywebview? Anyway, I really need this feature and hope it can be merged. Thanks!