diff options
| author | Akshay Nair <phenax5@gmail.com> | 2025-04-20 22:57:32 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2025-05-02 16:17:49 +0530 |
| commit | 3f5325f59ba7f8552d093fdafd9674b713f3cad9 (patch) | |
| tree | 481c26e17714fd673c024aba3c3514586f0fe3bb /src/WindowActionRouter.cpp | |
| parent | 1dd6332756b38bf4bbffeef9db6599320c03ca9a (diff) | |
| download | null-browser-3f5325f59ba7f8552d093fdafd9674b713f3cad9.tar.gz null-browser-3f5325f59ba7f8552d093fdafd9674b713f3cad9.zip | |
Add scrolling controls
Diffstat (limited to '')
| -rw-r--r-- | src/WindowActionRouter.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/WindowActionRouter.cpp b/src/WindowActionRouter.cpp index 2eabc94..721a3e7 100644 --- a/src/WindowActionRouter.cpp +++ b/src/WindowActionRouter.cpp @@ -77,6 +77,21 @@ void WindowActionRouter::initialize(Configuration *config) { WITH_WEBVIEW_WINDOW(webview_id, window, { win_match.second->mediator()->open_devtools(webview_id); }) }); + + // Scroll + connect(&runtime, &LuaRuntime::webview_scroll_requested, this, + [this](WebViewId webview_id, int deltax, int deltay) { + WITH_WEBVIEW_WINDOW(webview_id, window, + { window->mediator()->scroll(webview_id, deltax, deltay); }); + }); + connect(&runtime, &LuaRuntime::webview_scroll_top_requested, this, [this](WebViewId webview_id) { + WITH_WEBVIEW_WINDOW(webview_id, window, { window->mediator()->scroll_to_top(webview_id); }); + }); + connect(&runtime, &LuaRuntime::webview_scroll_bottom_requested, this, + [this](WebViewId webview_id) { + WITH_WEBVIEW_WINDOW(webview_id, window, + { window->mediator()->scroll_to_bottom(webview_id); }); + }); } void WindowActionRouter::find_current_search_text(WebViewId webview_id, bool forward) { |
