aboutsummaryrefslogtreecommitdiff
path: root/src/browsertab.hpp
diff options
context:
space:
mode:
authorMike Skec <skec@protonmail.ch>2021-01-07 08:53:02 +1100
committerFelix Queißner <felix@ib-queissner.de>2021-01-07 09:44:02 +0100
commit9ed3c1693fbd777f64d390e5b2d795fa285ffb85 (patch)
tree25f677579979e046b70b6b8f6e457b10ab37169b /src/browsertab.hpp
parent50729c19ebf75ab91ee285fe7af86abbdaec411c (diff)
downloadkristall-9ed3c1693fbd777f64d390e5b2d795fa285ffb85.tar.gz
Remembered scroll adjustment
Now only scrolls back if the user navigated back/forward. This is a little more intuitive and makes it less confusing when user clicks a link to a cached page
Diffstat (limited to 'src/browsertab.hpp')
-rw-r--r--src/browsertab.hpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/browsertab.hpp b/src/browsertab.hpp
index 595e846..d706f72 100644
--- a/src/browsertab.hpp
+++ b/src/browsertab.hpp
@@ -40,6 +40,19 @@ struct DocumentStats
}
};
+enum RequestFlags : int
+{
+ None = 0,
+
+ // Forces request to be made to server
+ // instead of reading from cache.
+ DontReadFromCache = 1,
+
+ // If the user navigated back/forward
+ // (i.e if using back/forward buttons in toolbar)
+ NavigatedBackOrForward = 2,
+};
+
class BrowserTab : public QWidget
{
Q_OBJECT
@@ -53,7 +66,7 @@ public:
explicit BrowserTab(MainWindow * mainWindow);
~BrowserTab();
- void navigateTo(QUrl const & url, PushToHistory mode, bool no_cache_read = false);
+ void navigateTo(QUrl const & url, PushToHistory mode, RequestFlags flags = RequestFlags::None);
void navigateBack(const QModelIndex &history_index);
@@ -165,7 +178,7 @@ private:
this->addProtocolHandler(std::make_unique<T>());
}
- bool startRequest(QUrl const & url, ProtocolHandler::RequestOptions options, bool no_cache_read = false);
+ bool startRequest(QUrl const & url, ProtocolHandler::RequestOptions options, RequestFlags flags = RequestFlags::None);
void updateMouseCursor(bool waiting);