Skip to content
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 method for maximizing native application #2836

Merged
merged 1 commit into from
Apr 6, 2024

Conversation

Aues6uen11Z
Copy link
Contributor

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!

@falkoschindler
Copy link
Contributor

Thanks for the pull request, @Aues6uen11Z!
@rodja Do you remember why there was no maximize() method in the first place?

@falkoschindler falkoschindler added the enhancement New feature or request label Apr 6, 2024
@falkoschindler falkoschindler added this to the 1.4.21 milestone Apr 6, 2024
Copy link
Member

@rodja rodja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I just forgot it while creating the wrapper. Thanks @Aues6uen11Z.

@rodja rodja merged commit bcdae28 into zauberzeug:main Apr 6, 2024
1 check passed
@Aues6uen11Z
Copy link
Contributor Author

Wait, I found another problem, maximize becomes fullscreen in frameless mode. This is quite awkward because it's precisely the borderless window mode that necessitates invoking the maximize method to implement its own maximize button functionality. However, this doesn't seem to be an inherent issue with NiceGUI, given that pywebview exhibits the same problem. I have already reported the issue to r0x0r/pywebview#1357 and am hoping for a prompt resolution.😢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants