React to orientation selection

This commit is contained in:
Roberto Alsina 2020-01-31 20:57:37 -03:00
parent 98bcddaecd
commit 9970d18422
2 changed files with 6 additions and 4 deletions

View File

@ -11,7 +11,6 @@ So I went and wrote one.
* Allow per-monitor scaling * Allow per-monitor scaling
* Allow arbitrary monitor positioning * Allow arbitrary monitor positioning
* Implement "scale everything so all the pixels are the same size" (not done yet) * Implement "scale everything so all the pixels are the same size" (not done yet)
* Support rotation (not there yet)
## To try: ## To try:

View File

@ -99,9 +99,6 @@ class Window(QObject):
self.ui.resetButton.clicked.connect(self.do_reset) self.ui.resetButton.clicked.connect(self.do_reset)
self.ui.cancelButton.clicked.connect(self.ui.reject) self.ui.cancelButton.clicked.connect(self.ui.reject)
def orientation_changed(self):
print('Orientation: ', self.ui.orientationCombo.currentIndex())
def do_reset(self): def do_reset(self):
for n in self.xrandr_info: for n in self.xrandr_info:
self.xrandr_info[n].update(self.orig_xrandr_info[n]) self.xrandr_info[n].update(self.orig_xrandr_info[n])
@ -131,6 +128,12 @@ class Window(QObject):
self.adjust_view() self.adjust_view()
self.scale_changed() # Trigger scale labels update 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
self.mode_changed()
def mode_changed(self): def mode_changed(self):
mon = self.ui.screenCombo.currentText() mon = self.ui.screenCombo.currentText()
mode = self.ui.modes.currentText() mode = self.ui.modes.currentText()