Fix RTL arrangement of browser views (#2176)

This commit is contained in:
Abdo 2022-11-03 05:14:52 +03:00 committed by GitHub
parent 20d2a0f33b
commit e64784f093
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -140,9 +140,14 @@ class Browser(QMainWindow):
# restoreXXX() should be called after all child widgets have been created # restoreXXX() should be called after all child widgets have been created
# and attached to QMainWindow # and attached to QMainWindow
restoreGeom(self, "editor", 0) self._editor_state_key = (
"editorRTL"
if self.layoutDirection() == Qt.LayoutDirection.RightToLeft
else "editor"
)
restoreGeom(self, self._editor_state_key, 0)
restoreSplitter(self.form.splitter, "editor3") restoreSplitter(self.form.splitter, "editor3")
restoreState(self, "editor") restoreState(self, self._editor_state_key)
# responsive layout # responsive layout
self.aspect_ratio = self.width() / self.height() self.aspect_ratio = self.width() / self.height()
@ -348,8 +353,8 @@ class Browser(QMainWindow):
self.table.cleanup() self.table.cleanup()
self.sidebar.cleanup() self.sidebar.cleanup()
saveSplitter(self.form.splitter, "editor3") saveSplitter(self.form.splitter, "editor3")
saveGeom(self, "editor") saveGeom(self, self._editor_state_key)
saveState(self, "editor") saveState(self, self._editor_state_key)
self.teardownHooks() self.teardownHooks()
self.mw.maybeReset() self.mw.maybeReset()
aqt.dialogs.markClosed("Browser") aqt.dialogs.markClosed("Browser")