From ce78bc58d78121aafe3c3048ef2630b5485f00e4 Mon Sep 17 00:00:00 2001 From: tgwoodcock Date: Wed, 21 Sep 2022 15:14:25 +0200 Subject: [PATCH] Bug fix with window geometry The first time a user uses the program, some defualts are set for the size of the window when it appears. There was a bug in the definition, because QRect expects 4 ints but two ints and two floats were being passed. This has now fixed that. Version bump to reflect the change. --- src/hdf5view/__init__.py | 2 +- src/hdf5view/mainwindow.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/hdf5view/__init__.py b/src/hdf5view/__init__.py index ff3981c..bf0d0bc 100644 --- a/src/hdf5view/__init__.py +++ b/src/hdf5view/__init__.py @@ -1 +1 @@ -__version__ = '0.0.4dev0' +__version__ = '0.0.5dev0' diff --git a/src/hdf5view/mainwindow.py b/src/hdf5view/mainwindow.py index 7c246d3..40409b7 100644 --- a/src/hdf5view/mainwindow.py +++ b/src/hdf5view/mainwindow.py @@ -281,7 +281,10 @@ def load_settings(self): self.restoreGeometry(geometry) else: geometry = self.app.desktop().availableGeometry(self) - self.setGeometry(QRect(0, 0, geometry.width() * 0.8, geometry.height() * 0.7)) + self.setGeometry(QRect(0, + 0, + int(geometry.width() * 0.8), + int(geometry.height() * 0.7))) # Restore the window state window_state = settings.value('windowState')