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

Auto-resize new qube window to screen size #232

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions qubes_config/new_qube/new_qube_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,20 @@
self.perform_setup()
assert self.main_window
self.main_window.show()
if self.main_window.get_allocated_width() > \

Check warning on line 84 in qubes_config/new_qube/new_qube_app.py

View check run for this annotation

Codecov / codecov/patch

qubes_config/new_qube/new_qube_app.py#L84

Added line #L84 was not covered by tests
self.main_window.get_screen().get_width():
width = int(self.main_window.get_screen().get_width() * 0.9)

Check warning on line 86 in qubes_config/new_qube/new_qube_app.py

View check run for this annotation

Codecov / codecov/patch

qubes_config/new_qube/new_qube_app.py#L86

Added line #L86 was not covered by tests
else:
# try to have at least 1100 pixels
width = min(int(self.main_window.get_screen().get_width() * 0.9),

Check warning on line 89 in qubes_config/new_qube/new_qube_app.py

View check run for this annotation

Codecov / codecov/patch

qubes_config/new_qube/new_qube_app.py#L89

Added line #L89 was not covered by tests
800)
if self.main_window.get_allocated_height() > \

Check warning on line 91 in qubes_config/new_qube/new_qube_app.py

View check run for this annotation

Codecov / codecov/patch

qubes_config/new_qube/new_qube_app.py#L91

Added line #L91 was not covered by tests
self.main_window.get_screen().get_height() * 0.9:
height = int(self.main_window.get_screen().get_height() * 0.9)

Check warning on line 93 in qubes_config/new_qube/new_qube_app.py

View check run for this annotation

Codecov / codecov/patch

qubes_config/new_qube/new_qube_app.py#L93

Added line #L93 was not covered by tests
else:
height = self.main_window.get_allocated_height()
self.main_window.resize(width, height)

Check warning on line 96 in qubes_config/new_qube/new_qube_app.py

View check run for this annotation

Codecov / codecov/patch

qubes_config/new_qube/new_qube_app.py#L95-L96

Added lines #L95 - L96 were not covered by tests

self.hold()

def perform_setup(self):
Expand Down