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)}]"