mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Keyb shortcuts for next/prev change
This commit is contained in:
parent
4ac45ee354
commit
541611d509
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user