Commit c29b6092 authored by Thorsten Wißmann's avatar Thorsten Wißmann 🎸 Committed by Philipp Erhardt
Browse files

Add manual jump list adding

Allow user to manually add entries to the jump list. Similar to m in
vim.
parent 67bb9cef
......@@ -107,6 +107,10 @@ KEY BINDINGS
Rotate pages left/right.
*\^o*, *^i*, *Alt-Left*, *Alt-Right* ::
Move backward/forward through the jump list. Entries are added automatically when jumping.
*m* ::
Manually add the current page to the jump list.
*i* ::
Toggle between normal and inverted color rendering.
......
......@@ -71,6 +71,7 @@ CFG::CFG() :
keys["rotate_right"] = QStringList() << ".";
keys["jump_back"] = QStringList() << "Ctrl+O" << "Alt+Left";
keys["jump_forward"] = QStringList() << "Ctrl+I" << "Alt+Right";
keys["mark_jump"] = QStringList() << "m";
keys["toggle_invert_colors"] = QStringList() << "i";
// viewer keys
keys["toggle_fullscreen"] = QStringList() << "F";
......
......@@ -200,6 +200,11 @@ void Viewer::jump_forward() {
}
}
void Viewer::mark_jump() {
int page = canvas->get_layout()->get_page();
res->store_jump(page);
}
// general movement
void Viewer::page_up() {
if (canvas->get_layout()->scroll_page(-1)) {
......@@ -508,6 +513,7 @@ void Viewer::setup_keys(QWidget *base) {
add_action(base, "open", SLOT(open()));
add_action(base, "jump_back", SLOT(jump_back()));
add_action(base, "jump_forward", SLOT(jump_forward()));
add_action(base, "mark_jump", SLOT(mark_jump()));
add_action(base, "page_up", SLOT(page_up()));
add_action(base, "page_down", SLOT(page_down()));
......
......@@ -38,6 +38,7 @@ public slots:
void open();
void jump_back();
void jump_forward();
void mark_jump();
private slots:
void page_up();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment