From daa5edcead9bf1843e4a4af50249b5f31d87db42 Mon Sep 17 00:00:00 2001 From: yggverse Date: Mon, 12 Aug 2024 19:11:00 +0300 Subject: [PATCH] implement tab close action --- src/app/browser.cpp | 13 +++++++++++++ src/app/browser.hpp | 2 ++ src/app/browser/main.cpp | 5 +++++ src/app/browser/main.hpp | 2 ++ 4 files changed, 22 insertions(+) diff --git a/src/app/browser.cpp b/src/app/browser.cpp index 47fb06fb..3f296be1 100644 --- a/src/app/browser.cpp +++ b/src/app/browser.cpp @@ -41,6 +41,14 @@ Browser::Browser( ) ); + add_action( + "tab_close", + sigc::mem_fun( + * this, + & Browser::main_tab_close + ) + ); + add_action( "debug", sigc::mem_fun( @@ -66,6 +74,11 @@ void Browser::main_tab_append() main->tab_append(); }; +void Browser::main_tab_close() +{ + main->tab_close(); +}; + void Browser::debug() { gtk_window_set_interactive_debugging( diff --git a/src/app/browser.hpp b/src/app/browser.hpp index 137210b8..ba34409e 100644 --- a/src/app/browser.hpp +++ b/src/app/browser.hpp @@ -39,6 +39,8 @@ namespace app void main_tab_append(); + void main_tab_close(); + void debug(); }; } diff --git a/src/app/browser/main.cpp b/src/app/browser/main.cpp index b1e9fe70..38b2ae3d 100644 --- a/src/app/browser/main.cpp +++ b/src/app/browser/main.cpp @@ -40,4 +40,9 @@ void Main::tab_append() true, true ); +}; + +void Main::tab_close() +{ + tab->close(); }; \ No newline at end of file diff --git a/src/app/browser/main.hpp b/src/app/browser/main.hpp index 46abf673..5d01dd20 100644 --- a/src/app/browser/main.hpp +++ b/src/app/browser/main.hpp @@ -23,6 +23,8 @@ namespace app::browser ~Main(); void tab_append(); + + void tab_close(); }; }