aboutsummaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2021-01-27 20:25:15 +0100
committerFelix Queißner <felix@ib-queissner.de>2021-01-27 20:48:25 +0100
commita6aecaaa63037023e027f1273f99375f5067638c (patch)
treeec3b1c782cc70a924435b54f8fdcc23895edcb77 /src/mainwindow.cpp
parent17a90d8dde55c5f0adc230c1a78da3dd2f8af995 (diff)
downloadkristall-a6aecaaa63037023e027f1273f99375f5067638c.tar.gz
Use PageUp/Down to switch between tabs
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index d1f27d7..d656867 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -91,6 +91,34 @@ MainWindow::MainWindow(QApplication * app, QWidget *parent) :
}
}
+ {
+ QShortcut * sc = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_PageDown), this);
+ connect(sc, &QShortcut::activated, this, [this](){
+ int i = this->ui->browser_tabs->currentIndex();
+
+ if (i + 1 >= this->ui->browser_tabs->count())
+ i = 0;
+ else
+ i++;
+
+ this->ui->browser_tabs->setCurrentIndex(i);
+ });
+ }
+
+ {
+ QShortcut * sc = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_PageUp), this);
+ connect(sc, &QShortcut::activated, this, [this](){
+ int i = this->ui->browser_tabs->currentIndex();
+
+ if (!i)
+ i = this->ui->browser_tabs->count() - 1;
+ else
+ i--;
+
+ this->ui->browser_tabs->setCurrentIndex(i);
+ });
+ }
+
this->ui->favourites_view->setContextMenuPolicy(Qt::CustomContextMenu);
this->ui->history_view->setContextMenuPolicy(Qt::CustomContextMenu);