From d5f0c59b574dd4ab3a36d7f39412ddc2389297d2 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Fri, 9 Sep 2022 22:07:51 -0400 Subject: [PATCH] Ignore resize events with the same height (for now) --- piker/ui/_window.py | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/piker/ui/_window.py b/piker/ui/_window.py index 5d720c0b..e574da23 100644 --- a/piker/ui/_window.py +++ b/piker/ui/_window.py @@ -158,7 +158,7 @@ class MainWindow(QtGui.QMainWindow): # XXX: for tiling wms this should scale # with the alloted window size. # TODO: detect for tiling and if untrue set some size? - size = (300, 500) + # size = (300, 500) godwidget: GodWidget title = 'piker chart (ur symbol is loading bby)' @@ -303,9 +303,31 @@ class MainWindow(QtGui.QMainWindow): self.resize(*size or self._size) def resizeEvent(self, event: QtCore.QEvent) -> None: - print('window resize') - # self.godwidget.resizeEvent(event) + if ( + # event.spontaneous() + event.oldSize().height == event.size().height + ): + event.ignore() + return + + # XXX: uncomment for debugging.. + # attrs = {} + # for key in dir(event): + # if key == '__dir__': + # continue + # attr = getattr(event, key) + # try: + # attrs[key] = attr() + # except TypeError: + # attrs[key] = attr + + # from pprint import pformat + # print( + # f'{pformat(attrs)}\n' + # f'WINDOW RESIZE: {self.size()}\n\n' + # ) self.godwidget.on_win_resize(event) + event.accept() # singleton app per actor