mirror of
https://github.com/Murmele/Gittyup.git
synced 2024-09-11 02:35:41 +03:00
Add hotkeys: nextCommit and prevCommit
This commit is contained in:
parent
dac06473c0
commit
770ac3c7a5
@ -28,6 +28,7 @@
|
||||
#include "git/Signature.h"
|
||||
#include "git/TagRef.h"
|
||||
#include "git/Tree.h"
|
||||
#include "ui/HotkeyManager.h"
|
||||
#include <QAbstractListModel>
|
||||
#include <QApplication>
|
||||
#include <QMenu>
|
||||
@ -1168,6 +1169,12 @@ public:
|
||||
|
||||
} // namespace
|
||||
|
||||
static Hotkey prevCommitHotKey = HotkeyManager::registerHotkey(
|
||||
"J", "commitList/prevCommit", "CommitList/PrevCommit");
|
||||
|
||||
static Hotkey nextCommitHotKey = HotkeyManager::registerHotkey(
|
||||
"K", "commitList/nextCommit", "CommitList/NextCommit");
|
||||
|
||||
CommitList::CommitList(Index *index, QWidget *parent)
|
||||
: QListView(parent), mIndex(index) {
|
||||
Theme *theme = Application::theme();
|
||||
@ -1223,6 +1230,18 @@ CommitList::CommitList(Index *index, QWidget *parent)
|
||||
connect(this, &CommitList::entered,
|
||||
[this](const QModelIndex &index) { update(index); });
|
||||
|
||||
QShortcut *shortcut = new QShortcut(this);
|
||||
prevCommitHotKey.use(shortcut);
|
||||
connect(shortcut, &QShortcut::activated, [this] {
|
||||
printf("prevCommit\n");
|
||||
});
|
||||
|
||||
shortcut = new QShortcut(this);
|
||||
nextCommitHotKey.use(shortcut);
|
||||
connect(shortcut, &QShortcut::activated, [this] {
|
||||
printf("nextCommit\n");
|
||||
});
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
QFont font = this->font();
|
||||
font.setPointSize(13);
|
||||
|
Loading…
Reference in New Issue
Block a user