From eb3f31cf1566e430fba658d4b66392ada0dac2d8 Mon Sep 17 00:00:00 2001 From: Roberto Alsina Date: Wed, 5 Feb 2020 20:12:50 -0300 Subject: [PATCH] made orientation selection work --- xrandroll/main.py | 6 +++--- xrandroll/monitor_item.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/xrandroll/main.py b/xrandroll/main.py index 8884238..95c4507 100644 --- a/xrandroll/main.py +++ b/xrandroll/main.py @@ -251,9 +251,9 @@ class Window(QObject): # self.scale_changed() # Trigger scale labels update def orientation_changed(self): - mon = self.ui.screenCombo.currentText() - orientation = self.ui.orientationCombo.currentIndex() - self.xrandr_info[mon]["orientation"] = orientation + mon_name = self.ui.screenCombo.currentText() + orientation = self.ui.orientationCombo.currentText().split()[0].lower() + self.screen.monitors[mon_name].orientation = orientation self.mode_changed() def mode_changed(self): diff --git a/xrandroll/monitor_item.py b/xrandroll/monitor_item.py index c32fe4d..8d2a209 100644 --- a/xrandroll/monitor_item.py +++ b/xrandroll/monitor_item.py @@ -22,11 +22,11 @@ class MonitorItem(QGraphicsRectItem, QObject): self.setPos(monitor.pos_x, monitor.pos_y) if monitor.orientation == "normal": self.bottom_edge.setRect(0, monitor.res_y - 50, monitor.res_x, 50) - elif monitor.orientation == 1: + elif monitor.orientation == "left": self.bottom_edge.setRect(monitor.res_x - 50, 0, 50, monitor.res_y) - elif monitor.orientation == 2: + elif monitor.orientation == "inverted": self.bottom_edge.setRect(0, 0, monitor.res_x, 50) - elif monitor.orientation == 3: + elif monitor.orientation == "right": self.bottom_edge.setRect(0, 0, 50, monitor.res_y) if monitor.replica_of: label_text = f"{self.name} [{','.join(monitor.replica_of)}]"