diff options
| author | Akshay Nair <phenax5@gmail.com> | 2025-04-19 17:56:03 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2025-04-19 17:56:03 +0530 |
| commit | 0e95e99e72237058465959d55b77750a9d7c1bef (patch) | |
| tree | 5b99cd64f7c49b949a6381c4654ec253822934b5 /src/WindowActionRouter.cpp | |
| parent | 7a458b424c2c1a6ed251211b25261acffef59b7f (diff) | |
| download | null-browser-0e95e99e72237058465959d55b77750a9d7c1bef.tar.gz null-browser-0e95e99e72237058465959d55b77750a9d7c1bef.zip | |
Add web.search and search text implemnetation
Diffstat (limited to '')
| -rw-r--r-- | src/WindowActionRouter.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/WindowActionRouter.cpp b/src/WindowActionRouter.cpp index d0b529b..5f787c0 100644 --- a/src/WindowActionRouter.cpp +++ b/src/WindowActionRouter.cpp @@ -58,6 +58,23 @@ void WindowActionRouter::initialize(Configuration *config) { WITH_WEBVIEW_WINDOW(webview_id, window, { emit window->mediator()->webview_selected(webview_id); }); }); + connect(&runtime, &LuaRuntime::search_requested, this, + [this](const QString &text, WebViewId webview_id) { + WITH_WEBVIEW_WINDOW(webview_id, window, { + this->current_search_text = text; + win_match.second->mediator()->set_search_text(text, webview_id, true); + }) + }); + connect(&runtime, &LuaRuntime::search_next_requested, this, [this](WebViewId webview_id) { + WITH_WEBVIEW_WINDOW(webview_id, window, { + win_match.second->mediator()->set_search_text(this->current_search_text, webview_id, true); + }) + }); + connect(&runtime, &LuaRuntime::search_previous_requested, this, [this](WebViewId webview_id) { + WITH_WEBVIEW_WINDOW(webview_id, window, { + win_match.second->mediator()->set_search_text(this->current_search_text, webview_id, false); + }) + }); } void WindowActionRouter::add_window(BrowserWindow *window) { |
