aboutsummaryrefslogtreecommitdiff
path: root/src/widgets/WebViewStack.cpp
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2025-04-20 22:57:32 +0530
committerAkshay Nair <phenax5@gmail.com>2025-05-02 16:17:49 +0530
commit3f5325f59ba7f8552d093fdafd9674b713f3cad9 (patch)
tree481c26e17714fd673c024aba3c3514586f0fe3bb /src/widgets/WebViewStack.cpp
parent1dd6332756b38bf4bbffeef9db6599320c03ca9a (diff)
downloadnull-browser-3f5325f59ba7f8552d093fdafd9674b713f3cad9.tar.gz
null-browser-3f5325f59ba7f8552d093fdafd9674b713f3cad9.zip
Add scrolling controls
Diffstat (limited to '')
-rw-r--r--src/widgets/WebViewStack.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/widgets/WebViewStack.cpp b/src/widgets/WebViewStack.cpp
index 9eef92a..53224c5 100644
--- a/src/widgets/WebViewStack.cpp
+++ b/src/widgets/WebViewStack.cpp
@@ -276,3 +276,33 @@ void WebViewStack::set_webview_url(const QUrl &url, WebViewId webview_id) {
webview->setUrl(url);
}
+
+void WebViewStack::scroll(WebViewId webview_id, int deltax, int deltay) {
+ auto *webview = get_webview(webview_id);
+ if (webview == nullptr) {
+ qDebug() << "Webview does not exist";
+ return;
+ }
+
+ webview->scroll_increment(deltax, deltay);
+}
+
+void WebViewStack::scroll_to_top(WebViewId webview_id) {
+ auto *webview = get_webview(webview_id);
+ if (webview == nullptr) {
+ qDebug() << "Webview does not exist";
+ return;
+ }
+
+ webview->scroll_to_top();
+}
+
+void WebViewStack::scroll_to_bottom(WebViewId webview_id) {
+ auto *webview = get_webview(webview_id);
+ if (webview == nullptr) {
+ qDebug() << "Webview does not exist";
+ return;
+ }
+
+ webview->scroll_to_bottom();
+}