aboutsummaryrefslogtreecommitdiff
path: root/tabbrowsinghistory.cpp
diff options
context:
space:
mode:
authorFelix (xq) Queißner <git@mq32.de>2020-06-06 20:57:56 +0200
committerFelix (xq) Queißner <git@mq32.de>2020-06-06 20:57:56 +0200
commiteb283439a68dfb70a075205859d891dca831626b (patch)
treeb54923af31c8e05e804b36860ef9bb968f1aee99 /tabbrowsinghistory.cpp
parent304bed8a1f567e7ba247d19ecbeeecd40833db04 (diff)
downloadkristall-eb283439a68dfb70a075205859d891dca831626b.tar.gz
Improves navigation with hotkeys, adds sane default theme, adds page margin settings.
Diffstat (limited to 'tabbrowsinghistory.cpp')
-rw-r--r--tabbrowsinghistory.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/tabbrowsinghistory.cpp b/tabbrowsinghistory.cpp
index 289d529..435bca7 100644
--- a/tabbrowsinghistory.cpp
+++ b/tabbrowsinghistory.cpp
@@ -41,6 +41,24 @@ QUrl TabBrowsingHistory::get(const QModelIndex &index) const
return history.at(index.row());
}
+QModelIndex TabBrowsingHistory::oneForward(QModelIndex index) const
+{
+ if(not index.isValid())
+ return QModelIndex{};
+ if(index.row() >= history.size() - 1)
+ return QModelIndex{};
+ return createIndex(index.row() + 1, index.column());
+}
+
+QModelIndex TabBrowsingHistory::oneBackward(QModelIndex index) const
+{
+ if(not index.isValid())
+ return QModelIndex{};
+ if(index.row() == 0)
+ return QModelIndex{};
+ return createIndex(index.row() - 1, index.column());
+}
+
int TabBrowsingHistory::rowCount(const QModelIndex &parent) const
{
return history.size();