diff --git a/src/app/browser/header.cpp b/src/app/browser/header.cpp index 32d819b9..7739044c 100644 --- a/src/app/browser/header.cpp +++ b/src/app/browser/header.cpp @@ -42,7 +42,9 @@ Header::Header( * headerMenu ); - headerTab = Gtk::make_managed(); + headerTab = Gtk::make_managed( + ACTION__TAB_APPEND + ); pack_start( * headerTab diff --git a/src/app/browser/header/tab.cpp b/src/app/browser/header/tab.cpp index 8bdf2aa9..1b27bd4c 100644 --- a/src/app/browser/header/tab.cpp +++ b/src/app/browser/header/tab.cpp @@ -2,12 +2,13 @@ using namespace app::browser::header; -Tab::Tab() -{ - set_action_name( - "win.main_tab_append" - ); +Tab::Tab( + const Glib::RefPtr & ACTION__TAB_APPEND +) { + // Init actions + action__tab_append = ACTION__TAB_APPEND; + // Init widget set_icon_name( "tab-new-symbolic" ); @@ -15,4 +16,12 @@ Tab::Tab() set_tooltip_text( _("New tab") ); + + // Init events + signal_clicked().connect( + [this] + { + action__tab_append->activate(); + } + ); } \ No newline at end of file diff --git a/src/app/browser/header/tab.hpp b/src/app/browser/header/tab.hpp index a2d1d0e3..a71e26fc 100644 --- a/src/app/browser/header/tab.hpp +++ b/src/app/browser/header/tab.hpp @@ -1,16 +1,22 @@ #ifndef APP_BROWSER_HEADER_TAB_HPP #define APP_BROWSER_HEADER_TAB_HPP +#include #include +#include #include namespace app::browser::header { class Tab : public Gtk::Button { + Glib::RefPtr action__tab_append; + public: - Tab(); + Tab( + const Glib::RefPtr & ACTION__TAB_APPEND + ); }; }