mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
Adjust arrows direction for RTL layouts in previewer (#1513)
This commit is contained in:
parent
8edca4e6c1
commit
5a3999d0c8
1 changed files with 9 additions and 2 deletions
|
@ -80,6 +80,7 @@ class Previewer(QDialog):
|
||||||
self._web = AnkiWebView(title="previewer")
|
self._web = AnkiWebView(title="previewer")
|
||||||
self.vbox.addWidget(self._web)
|
self.vbox.addWidget(self._web)
|
||||||
self.bbox = QDialogButtonBox()
|
self.bbox = QDialogButtonBox()
|
||||||
|
self.bbox.setLayoutDirection(Qt.LayoutDirection.LeftToRight)
|
||||||
|
|
||||||
self._replay = self.bbox.addButton(
|
self._replay = self.bbox.addButton(
|
||||||
tr.actions_replay_audio(), QDialogButtonBox.ButtonRole.ActionRole
|
tr.actions_replay_audio(), QDialogButtonBox.ButtonRole.ActionRole
|
||||||
|
@ -263,12 +264,18 @@ class MultiCardPreviewer(Previewer):
|
||||||
|
|
||||||
def _create_gui(self) -> None:
|
def _create_gui(self) -> None:
|
||||||
super()._create_gui()
|
super()._create_gui()
|
||||||
self._prev = self.bbox.addButton("<", QDialogButtonBox.ButtonRole.ActionRole)
|
self._prev = self.bbox.addButton(
|
||||||
|
">" if self.layoutDirection() == Qt.LayoutDirection.RightToLeft else "<",
|
||||||
|
QDialogButtonBox.ButtonRole.ActionRole,
|
||||||
|
)
|
||||||
self._prev.setAutoDefault(False)
|
self._prev.setAutoDefault(False)
|
||||||
self._prev.setShortcut(QKeySequence("Left"))
|
self._prev.setShortcut(QKeySequence("Left"))
|
||||||
self._prev.setToolTip(tr.qt_misc_shortcut_key_left_arrow())
|
self._prev.setToolTip(tr.qt_misc_shortcut_key_left_arrow())
|
||||||
|
|
||||||
self._next = self.bbox.addButton(">", QDialogButtonBox.ButtonRole.ActionRole)
|
self._next = self.bbox.addButton(
|
||||||
|
"<" if self.layoutDirection() == Qt.LayoutDirection.RightToLeft else ">",
|
||||||
|
QDialogButtonBox.ButtonRole.ActionRole,
|
||||||
|
)
|
||||||
self._next.setAutoDefault(True)
|
self._next.setAutoDefault(True)
|
||||||
self._next.setShortcut(QKeySequence("Right"))
|
self._next.setShortcut(QKeySequence("Right"))
|
||||||
self._next.setToolTip(tr.qt_misc_shortcut_key_right_arrow_or_enter())
|
self._next.setToolTip(tr.qt_misc_shortcut_key_right_arrow_or_enter())
|
||||||
|
|
Loading…
Reference in a new issue