Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/pr/232'
Browse files Browse the repository at this point in the history
* origin/pr/232:
  Auto-resize new qube window to screen size
  • Loading branch information
marmarek committed Nov 15, 2024
2 parents 83b2fab + 2b26834 commit ead934e
Showing 1 changed file with 14 additions and 0 deletions.
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 @@ def do_activate(self, *args, **kwargs):
self.perform_setup()
assert self.main_window
self.main_window.show()
if self.main_window.get_allocated_width() > \
self.main_window.get_screen().get_width():
width = int(self.main_window.get_screen().get_width() * 0.9)
else:
# try to have at least 1100 pixels
width = min(int(self.main_window.get_screen().get_width() * 0.9),
800)
if self.main_window.get_allocated_height() > \
self.main_window.get_screen().get_height() * 0.9:
height = int(self.main_window.get_screen().get_height() * 0.9)
else:
height = self.main_window.get_allocated_height()
self.main_window.resize(width, height)

self.hold()

def perform_setup(self):
Expand Down

0 comments on commit ead934e

Please sign in to comment.