From c54c9ae3d3fa95f836bda580c14908dfc5f301ae Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Thu, 10 Feb 2022 14:20:15 -0500 Subject: [PATCH] Add doc string to DE sizing method --- piker/ui/_window.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/piker/ui/_window.py b/piker/ui/_window.py index be43a261..9dbe6704 100644 --- a/piker/ui/_window.py +++ b/piker/ui/_window.py @@ -273,7 +273,16 @@ class MainWindow(QtGui.QMainWindow): def configure_to_desktop( self, size: Optional[tuple[int, int]] = None, + ) -> None: + ''' + Explicitly size the window dimensions (for stacked window + managers). + + For tina systems (like windoze) try to do a sane window size on + startup. + + ''' # https://stackoverflow.com/a/18975846 if not size and not self._size: app = QtGui.QApplication.instance() @@ -282,7 +291,7 @@ class MainWindow(QtGui.QMainWindow): self.setMaximumSize(w, h) # use approx 1/3 of the area of the screen by default self._size = round(w * .666), round(h * .666) - + self.resize(*size or self._size)