From 1284f8cf39e8ba44e837d4dac0bace89cb7a0c26 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Tue, 25 Mar 2025 20:26:40 +0530 Subject: Refactor webview index with id + add web.tabs.close --- src/InputMediator.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/InputMediator.cpp') diff --git a/src/InputMediator.cpp b/src/InputMediator.cpp index 1d86a2a..2a36665 100644 --- a/src/InputMediator.cpp +++ b/src/InputMediator.cpp @@ -15,16 +15,17 @@ InputMediator::InputMediator(WebViewStack *webview_stack, keymap_evaluator(keymap_evaluator) { connect(lua_runtime, &LuaRuntime::url_opened, webview_stack, &WebViewStack::open_url); - connect(lua_runtime, &LuaRuntime::keymap_add_requested, this, + connect(lua_runtime, &LuaRuntime::keymap_added, this, &InputMediator::add_keymap); connect(lua_runtime, &LuaRuntime::history_back_requested, webview_stack, &WebViewStack::webview_history_back); connect(lua_runtime, &LuaRuntime::history_forward_requested, webview_stack, &WebViewStack::webview_history_forward); + connect(lua_runtime, &LuaRuntime::webview_closed, webview_stack, + &WebViewStack::close); - lua_runtime->set_current_tab_id_fetcher([this]() { - return this->webview_stack->current_webview_index(); - }); + lua_runtime->set_current_tab_id_fetcher( + [this]() { return this->webview_stack->current_webview_id(); }); } void InputMediator::add_keymap(const QString &mode_string, -- cgit v1.3.1