diff --git a/src/app/browser.cpp b/src/app/browser.cpp index 6954a2da..9eef1416 100644 --- a/src/app/browser.cpp +++ b/src/app/browser.cpp @@ -51,8 +51,8 @@ Browser::Browser( "t" ); - const auto ACTION__MAIN_TAB_CLOSE = add_action( - "main_tab_close", + const auto ACTION__MAIN_TAB_CLOSE_ACTIVE = add_action( + "main_tab_close_active", [this] { browserMain->tab_close(); @@ -79,16 +79,18 @@ Browser::Browser( false ); - add_action( + const auto ACTION__MAIN_TAB_CLOSE_ALL = add_action( "main_tab_close_all", [this] { browserMain->tab_close_all(); } - )->set_enabled( - false ); + ACTION__MAIN_TAB_CLOSE_ALL->set_enabled( + false + ); + const auto ACTION__MAIN_TAB_PAGE_NAVIGATION_UPDATE = add_action( "main_tab_page_navigation_update", [this] @@ -154,7 +156,8 @@ Browser::Browser( browserHeader = Gtk::make_managed( ACTION__DEBUG, ACTION__MAIN_TAB_APPEND, - ACTION__MAIN_TAB_CLOSE, + ACTION__MAIN_TAB_CLOSE_ACTIVE, + ACTION__MAIN_TAB_CLOSE_ALL, ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK, ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD, ACTION__MAIN_TAB_PAGE_NAVIGATION_UPDATE @@ -166,7 +169,7 @@ Browser::Browser( browserMain = Gtk::make_managed( ACTION__REFRESH, - ACTION__MAIN_TAB_CLOSE, + ACTION__MAIN_TAB_CLOSE_ACTIVE, ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK, ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD, ACTION__MAIN_TAB_PAGE_NAVIGATION_UPDATE diff --git a/src/app/browser/header.cpp b/src/app/browser/header.cpp index 28f1acad..98a94069 100644 --- a/src/app/browser/header.cpp +++ b/src/app/browser/header.cpp @@ -8,7 +8,8 @@ using namespace app::browser; Header::Header( const Glib::RefPtr & ACTION__DEBUG, const Glib::RefPtr & ACTION__MAIN_TAB_APPEND, - const Glib::RefPtr & ACTION__MAIN_TAB_CLOSE, + const Glib::RefPtr & ACTION__MAIN_TAB_CLOSE_ACTIVE, + const Glib::RefPtr & ACTION__MAIN_TAB_CLOSE_ALL, const Glib::RefPtr & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK, const Glib::RefPtr & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD, const Glib::RefPtr & ACTION__MAIN_TAB_PAGE_NAVIGATION_UPDATE @@ -22,7 +23,8 @@ Header::Header( headerMenu = Gtk::make_managed( ACTION__DEBUG, ACTION__MAIN_TAB_APPEND, - ACTION__MAIN_TAB_CLOSE, + ACTION__MAIN_TAB_CLOSE_ACTIVE, + ACTION__MAIN_TAB_CLOSE_ALL, ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK, ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD, ACTION__MAIN_TAB_PAGE_NAVIGATION_UPDATE diff --git a/src/app/browser/header.hpp b/src/app/browser/header.hpp index 4f90f296..ce83f26e 100644 --- a/src/app/browser/header.hpp +++ b/src/app/browser/header.hpp @@ -31,7 +31,8 @@ namespace app::browser Header( const Glib::RefPtr & ACTION__DEBUG, const Glib::RefPtr & ACTION__MAIN_TAB_APPEND, - const Glib::RefPtr & ACTION__MAIN_TAB_CLOSE, + const Glib::RefPtr & ACTION__MAIN_TAB_CLOSE_ACTIVE, + const Glib::RefPtr & ACTION__MAIN_TAB_CLOSE_ALL, const Glib::RefPtr & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK, const Glib::RefPtr & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD, const Glib::RefPtr & ACTION__MAIN_TAB_PAGE_NAVIGATION_UPDATE diff --git a/src/app/browser/header/menu.cpp b/src/app/browser/header/menu.cpp index 285e165a..8ca1e235 100644 --- a/src/app/browser/header/menu.cpp +++ b/src/app/browser/header/menu.cpp @@ -5,7 +5,8 @@ using namespace app::browser::header; Menu::Menu( const Glib::RefPtr & ACTION__DEBUG, const Glib::RefPtr & ACTION__MAIN_TAB_APPEND, - const Glib::RefPtr & ACTION__MAIN_TAB_CLOSE, + const Glib::RefPtr & ACTION__MAIN_TAB_CLOSE_ACTIVE, + const Glib::RefPtr & ACTION__MAIN_TAB_CLOSE_ALL, const Glib::RefPtr & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK, const Glib::RefPtr & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD, const Glib::RefPtr & ACTION__MAIN_TAB_PAGE_NAVIGATION_UPDATE @@ -74,7 +75,7 @@ Menu::Menu( MENU__MAIN_TAB_CLOSE->append( _("Active tab"), get_action_detailed_name( - ACTION__MAIN_TAB_CLOSE + ACTION__MAIN_TAB_CLOSE_ACTIVE ) ); @@ -83,24 +84,23 @@ Menu::Menu( MENU__MAIN_TAB_CLOSE->append( _("All tabs to left"), get_action_detailed_name( - ACTION__MAIN_TAB_CLOSE + ACTION__MAIN_TAB_CLOSE_LEFT ) ); MENU__MAIN_TAB_CLOSE->append( _("All tabs to right"), get_action_detailed_name( - ACTION__MAIN_TAB_CLOSE + ACTION__MAIN_TAB_CLOSE_RIGHT ) ); - + */ MENU__MAIN_TAB_CLOSE->append( _("All tabs"), get_action_detailed_name( - ACTION__MAIN_TAB_CLOSE + ACTION__MAIN_TAB_CLOSE_ALL ) ); - */ MENU__MAIN_TAB->append_submenu( _("Close"), diff --git a/src/app/browser/header/menu.hpp b/src/app/browser/header/menu.hpp index bf57677d..aaa86091 100644 --- a/src/app/browser/header/menu.hpp +++ b/src/app/browser/header/menu.hpp @@ -20,7 +20,8 @@ namespace app::browser::header Menu( const Glib::RefPtr & ACTION__DEBUG, const Glib::RefPtr & ACTION__MAIN_TAB_APPEND, - const Glib::RefPtr & ACTION__MAIN_TAB_CLOSE, + const Glib::RefPtr & ACTION__MAIN_TAB_CLOSE_ACTIVE, + const Glib::RefPtr & ACTION__MAIN_TAB_CLOSE_ALL, const Glib::RefPtr & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK, const Glib::RefPtr & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD, const Glib::RefPtr & ACTION__MAIN_TAB_PAGE_NAVIGATION_UPDATE diff --git a/src/app/browser/main.cpp b/src/app/browser/main.cpp index 5b914cba..0a0e3a44 100644 --- a/src/app/browser/main.cpp +++ b/src/app/browser/main.cpp @@ -5,7 +5,7 @@ using namespace app::browser; Main::Main( const Glib::RefPtr & ACTION__REFRESH, - const Glib::RefPtr & ACTION__MAIN_TAB_CLOSE, + const Glib::RefPtr & ACTION__MAIN_TAB_CLOSE_ACTIVE, const Glib::RefPtr & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK, const Glib::RefPtr & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD, const Glib::RefPtr & ACTION__MAIN_TAB_PAGE_NAVIGATION_UPDATE @@ -22,7 +22,7 @@ Main::Main( // Init components mainTab = Gtk::make_managed( ACTION__REFRESH, - ACTION__MAIN_TAB_CLOSE, + ACTION__MAIN_TAB_CLOSE_ACTIVE, ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK, ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD, ACTION__MAIN_TAB_PAGE_NAVIGATION_UPDATE diff --git a/src/app/browser/main.hpp b/src/app/browser/main.hpp index 41c66e57..b929863b 100644 --- a/src/app/browser/main.hpp +++ b/src/app/browser/main.hpp @@ -27,7 +27,7 @@ namespace app::browser Main( const Glib::RefPtr & ACTION__REFRESH, - const Glib::RefPtr & ACTION__MAIN_TAB_CLOSE, + const Glib::RefPtr & ACTION__MAIN_TAB_CLOSE_ACTIVE, const Glib::RefPtr & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK, const Glib::RefPtr & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD, const Glib::RefPtr & ACTION__MAIN_TAB_PAGE_NAVIGATION_UPDATE diff --git a/src/app/browser/main/tab.cpp b/src/app/browser/main/tab.cpp index 2ad07886..04d6c72f 100644 --- a/src/app/browser/main/tab.cpp +++ b/src/app/browser/main/tab.cpp @@ -6,14 +6,14 @@ using namespace app::browser::main; Tab::Tab( const Glib::RefPtr & ACTION__REFRESH, - const Glib::RefPtr & ACTION__TAB_CLOSE, + const Glib::RefPtr & ACTION__TAB_CLOSE_ACTIVE, const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK, const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD, const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_UPDATE ) { // Init actions action__refresh = ACTION__REFRESH; - action__tab_close = ACTION__TAB_CLOSE; + action__tab_close_active = ACTION__TAB_CLOSE_ACTIVE; action__tab_page_navigation_history_back = ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK; action__tab_page_navigation_history_forward = ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD; action__tab_page_navigation_update = ACTION__TAB_PAGE_NAVIGATION_UPDATE; @@ -65,7 +65,7 @@ void Tab::append( ); auto tabLabel = new tab::Label( - action__tab_close + action__tab_close_active ); int page_number = append_page( diff --git a/src/app/browser/main/tab.hpp b/src/app/browser/main/tab.hpp index e80d908c..4b7d23ef 100644 --- a/src/app/browser/main/tab.hpp +++ b/src/app/browser/main/tab.hpp @@ -19,7 +19,7 @@ namespace app::browser::main { // Actions Glib::RefPtr action__refresh, - action__tab_close, + action__tab_close_active, action__tab_page_navigation_history_back, action__tab_page_navigation_history_forward, action__tab_page_navigation_update; @@ -41,7 +41,7 @@ namespace app::browser::main Tab( const Glib::RefPtr & ACTION__REFRESH, - const Glib::RefPtr & ACTION__TAB_CLOSE, + const Glib::RefPtr & ACTION__TAB_CLOSE_ACTIVE, const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK, const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD, const Glib::RefPtr & ACTION__TAB_PAGE_NAVIGATION_UPDATE diff --git a/src/app/browser/main/tab/label.cpp b/src/app/browser/main/tab/label.cpp index d146cf9d..5ab17c8d 100644 --- a/src/app/browser/main/tab/label.cpp +++ b/src/app/browser/main/tab/label.cpp @@ -3,10 +3,10 @@ using namespace app::browser::main::tab; Label::Label( - const Glib::RefPtr & ACTION__CLOSE + const Glib::RefPtr & ACTION__CLOSE_ACTIVE ) { // Init actions - action__close = ACTION__CLOSE; + action__close_active = ACTION__CLOSE_ACTIVE; // Setup label controller auto GtkGestureClick = Gtk::GestureClick::create(); @@ -21,7 +21,7 @@ Label::Label( { if (n == 2) // double click { - action__close->activate(); + action__close_active->activate(); } } ); diff --git a/src/app/browser/main/tab/label.hpp b/src/app/browser/main/tab/label.hpp index d0fab41a..05ce8586 100644 --- a/src/app/browser/main/tab/label.hpp +++ b/src/app/browser/main/tab/label.hpp @@ -12,12 +12,12 @@ namespace app::browser::main::tab { class Label : public Gtk::Label { - Glib::RefPtr action__close; + Glib::RefPtr action__close_active; public: Label( - const Glib::RefPtr & ACTION__CLOSE + const Glib::RefPtr & ACTION__CLOSE_ACTIVE ); }; }