From 1e5e3fe81abedd44473e9f26ea956c9dc387b359 Mon Sep 17 00:00:00 2001 From: Roberto Alsina Date: Fri, 31 Jan 2020 17:10:18 -0300 Subject: [PATCH] slightly better autoresizing, not great --- main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index cfec950..3b1a305 100644 --- a/main.py +++ b/main.py @@ -92,10 +92,12 @@ class Window(QObject): self.update_replica_of_data() for _, mon in self.xrandr_info.items(): mon['item'].update_visuals(mon) + self.adjust_view() def adjust_view(self): + self.ui.sceneView.resetTransform() self.ui.sceneView.ensureVisible(self.scene.sceneRect(), 100, 100) - scale_factor = 0.7 * min( + scale_factor = .8 * min( self.ui.sceneView.width() / self.scene.sceneRect().width(), self.ui.sceneView.height() / self.scene.sceneRect().height(), )