diff --git a/src/calibre/gui2/tweak_book/diff/main.py b/src/calibre/gui2/tweak_book/diff/main.py index 05236af518..81f2603551 100644 --- a/src/calibre/gui2/tweak_book/diff/main.py +++ b/src/calibre/gui2/tweak_book/diff/main.py @@ -211,14 +211,14 @@ class Diff(Dialog): self.bp = b = QToolButton(self) b.setIcon(QIcon(I('back.png'))) b.clicked.connect(partial(self.view.next_change, -1)) - b.setToolTip(_('Go to previous change')) + b.setToolTip(_('Go to previous change') + ' [p]') b.setText(_('&Previous change')), b.setToolButtonStyle(Qt.ToolButtonTextBesideIcon) l.addWidget(b, r, l.columnCount(), 1, 1) self.bn = b = QToolButton(self) b.setIcon(QIcon(I('forward.png'))) b.clicked.connect(partial(self.view.next_change, 1)) - b.setToolTip(_('Go to next change')) + b.setToolTip(_('Go to next change') + ' [n]') b.setText(_('&Next change')), b.setToolButtonStyle(Qt.ToolButtonTextBesideIcon) l.addWidget(b, r, l.columnCount(), 1, 1) diff --git a/src/calibre/gui2/tweak_book/diff/view.py b/src/calibre/gui2/tweak_book/diff/view.py index fc1af271d0..dcbdc85593 100644 --- a/src/calibre/gui2/tweak_book/diff/view.py +++ b/src/calibre/gui2/tweak_book/diff/view.py @@ -1054,6 +1054,9 @@ class DiffView(QWidget): # {{{ elif key in (Qt.Key_Home, Qt.Key_End): self.scrollbar.setValue(0 if key == Qt.Key_Home else self.scrollbar.maximum()) return True + elif key in (Qt.Key_N, Qt.Key_P): + self.next_change(1 if key == Qt.Key_N else -1) + return True if amount is not None: self.scrollbar.setValue(self.scrollbar.value() + d * amount)