diff options
author | Stuart Langridge <sil@kryogenix.org> | 2020-12-07 12:55:02 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-07 12:55:02 +0000 |
commit | dd2171ff15bfca584a52c659632fe3db1827ea38 (patch) | |
tree | 2f1fb4278078480ee34db7eeff476126f4d90375 | |
parent | Bump version to 1.0.3 (diff) | |
parent | Changed min_x and min_y to min_width and min_height for clarity. (diff) | |
download | magnus-dd2171ff15bfca584a52c659632fe3db1827ea38.tar.gz magnus-dd2171ff15bfca584a52c659632fe3db1827ea38.tar.bz2 magnus-dd2171ff15bfca584a52c659632fe3db1827ea38.zip |
Merge pull request #11 from bgarnham/resize-fix
fix restore_window_metrics to allow downward resizing below last stored size
-rwxr-xr-x | magnus | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -28,6 +28,8 @@ class Main(object): self.window_metrics_restored = False self.decorations_height = 0 self.decorations_width = 0 + self.min_width = 300 + self.min_height = 300 self.last_x = -1 self.last_y = -1 self.refresh_interval = 250 @@ -98,7 +100,7 @@ class Main(object): # the window self.w = Gtk.ApplicationWindow.new(self.app) - self.w.set_size_request(300, 300) + self.w.set_size_request(self.min_width, self.min_height) self.w.set_title("Magnus") self.w.connect("destroy", lambda a: self.app.quit()) self.w.connect("configure-event", self.read_window_size) @@ -293,7 +295,8 @@ class Main(object): scr = self.w.get_screen() sw = float(scr.get_width()) sh = float(scr.get_height()) - self.w.set_size_request( + self.w.set_size_request(self.min_width, self.min_height) + self.w.resize( int(sw * metrics["ww"]), int(sh * metrics["wh"])) self.w.move(int(sw * metrics["wx"]), int(sh * metrics["wy"])) |