aboutsummaryrefslogtreecommitdiff
path: root/mainwindow.cpp
diff options
context:
space:
mode:
authorFelix (xq) Queißner <git@mq32.de>2020-06-06 22:23:20 +0200
committerFelix (xq) Queißner <git@mq32.de>2020-06-06 22:23:20 +0200
commitd9e105e6e0accf5def8681334341069117cab213 (patch)
tree68764c76f67326aaa3f731ce70726e821c00e11a /mainwindow.cpp
parent87d787bc2c50eb00c6b86957efaa71e07f9acc07 (diff)
downloadkristall-d9e105e6e0accf5def8681334341069117cab213.tar.gz
Navigation via outline is now possible. Sexy!
Diffstat (limited to 'mainwindow.cpp')
-rw-r--r--mainwindow.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/mainwindow.cpp b/mainwindow.cpp
index 3682891..4b8d692 100644
--- a/mainwindow.cpp
+++ b/mainwindow.cpp
@@ -183,3 +183,15 @@ void MainWindow::on_nav_forward()
tab->navOneForward();
}
}
+
+void MainWindow::on_outline_view_clicked(const QModelIndex &index)
+{
+ BrowserTab * tab = qobject_cast<BrowserTab*>(this->ui->browser_tabs->currentWidget());
+ if(tab != nullptr) {
+
+ auto anchor = tab->outline.getAnchor(index);
+ if(not anchor.isEmpty()) {
+ tab->scrollToAnchor(anchor);
+ }
+ }
+}