mirror of
https://github.com/ralsina/xrandroll.git
synced 2024-11-22 02:52:23 +00:00
slightly better autoresizing, not great
This commit is contained in:
parent
ed55a157fe
commit
1e5e3fe81a
4
main.py
4
main.py
@ -92,10 +92,12 @@ class Window(QObject):
|
|||||||
self.update_replica_of_data()
|
self.update_replica_of_data()
|
||||||
for _, mon in self.xrandr_info.items():
|
for _, mon in self.xrandr_info.items():
|
||||||
mon['item'].update_visuals(mon)
|
mon['item'].update_visuals(mon)
|
||||||
|
self.adjust_view()
|
||||||
|
|
||||||
def adjust_view(self):
|
def adjust_view(self):
|
||||||
|
self.ui.sceneView.resetTransform()
|
||||||
self.ui.sceneView.ensureVisible(self.scene.sceneRect(), 100, 100)
|
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.width() / self.scene.sceneRect().width(),
|
||||||
self.ui.sceneView.height() / self.scene.sceneRect().height(),
|
self.ui.sceneView.height() / self.scene.sceneRect().height(),
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user