diff --git a/src/app/browser.cpp b/src/app/browser.cpp index 6ad78eed..1e5fb1a7 100644 --- a/src/app/browser.cpp +++ b/src/app/browser.cpp @@ -35,108 +35,68 @@ Browser::Browser( // Init actions add_action( "tab_append", - sigc::mem_fun( - * this, - & Browser::main_tab_append - ) + [this] + { + main->tab_append(); + } ); add_action( "tab_update", - sigc::mem_fun( - *this, - &Browser::main_tab_update - ) + [this] + { + main->tab_update(); + } ); // Close add_action( "tab_close", - sigc::mem_fun( - * this, - & Browser::main_tab_close - ) + [this] + { + main->tab_close(); + } ); // Close submenu add_action( "tab_close_left", - sigc::mem_fun( - * this, - & Browser::main_tab_close_left - ) + [this] + { + main->tab_close_left(); + } ); add_action( "tab_close_right", - sigc::mem_fun( - * this, - & Browser::main_tab_close_right - ) + [this] + { + main->tab_close_right(); + } ); add_action( "tab_close_all", - sigc::mem_fun( - * this, - & Browser::main_tab_close_all - ) + [this] + { + main->tab_close_all(); + } ); // Tool add_action( "debug", - sigc::mem_fun( - * this, - & Browser::debug - ) + [this] + { + gtk_window_set_interactive_debugging( + true + ); + } ); } Browser::~Browser() { - destroy(); - delete header; - header = nullptr; - delete main; - main = nullptr; -} - -void Browser::main_tab_append() -{ - main->tab_append(); -}; - -void Browser::main_tab_update() -{ - main->tab_update(); -}; - -void Browser::main_tab_close() -{ - main->tab_close(); -}; - -void Browser::main_tab_close_left() -{ - main->tab_close_left(); -}; - -void Browser::main_tab_close_right() -{ - main->tab_close_right(); -}; - -void Browser::main_tab_close_all() -{ - main->tab_close_all(); -}; - -void Browser::debug() -{ - gtk_window_set_interactive_debugging( - true - ); -}; \ No newline at end of file +} \ No newline at end of file diff --git a/src/app/browser.hpp b/src/app/browser.hpp index c630d02e..a4f77be4 100644 --- a/src/app/browser.hpp +++ b/src/app/browser.hpp @@ -32,16 +32,6 @@ namespace app ); ~Browser(); - - void main_tab_append(); - void main_tab_update(); - - void main_tab_close(); - void main_tab_close_left(); - void main_tab_close_right(); - void main_tab_close_all(); - - void debug(); }; } diff --git a/src/app/browser/main/tab.cpp b/src/app/browser/main/tab.cpp index 2f2ef5bf..2b6e688b 100644 --- a/src/app/browser/main/tab.cpp +++ b/src/app/browser/main/tab.cpp @@ -13,10 +13,13 @@ Tab::Tab() // Init events signal_switch_page().connect( - sigc::mem_fun( - * this, - & Tab::on_switch - ) + [this](Gtk::Widget * page, guint page_num) + { + on_switch( + page, + page_num + ); + } ); } diff --git a/src/app/browser/main/tab.hpp b/src/app/browser/main/tab.hpp index d5e038f2..2afb22f7 100644 --- a/src/app/browser/main/tab.hpp +++ b/src/app/browser/main/tab.hpp @@ -4,7 +4,6 @@ #include #include #include -#include namespace app::browser::main { diff --git a/src/app/browser/main/tab/label.cpp b/src/app/browser/main/tab/label.cpp index 769c2a1c..3c1dbb82 100644 --- a/src/app/browser/main/tab/label.cpp +++ b/src/app/browser/main/tab/label.cpp @@ -17,10 +17,12 @@ Label::Label() );*/ controller->signal_pressed().connect( - sigc::mem_fun( - * this, - & Label::on_click - ) + [this](int n, double x, double y) + { + on_click( + n, x, y + ); + } ); add_controller( diff --git a/src/app/browser/main/tab/label.hpp b/src/app/browser/main/tab/label.hpp index 384d7350..e2865495 100644 --- a/src/app/browser/main/tab/label.hpp +++ b/src/app/browser/main/tab/label.hpp @@ -5,7 +5,6 @@ #include #include #include -#include namespace app::browser::main::tab { diff --git a/src/app/browser/main/tab/page/navbar.cpp b/src/app/browser/main/tab/page/navbar.cpp index 7c181635..4910b18e 100644 --- a/src/app/browser/main/tab/page/navbar.cpp +++ b/src/app/browser/main/tab/page/navbar.cpp @@ -71,10 +71,10 @@ Navbar::Navbar() // Define group actions action_group->add_action( "refresh", - sigc::mem_fun( - * this, - & Navbar::refresh - ) + [this] + { + refresh(); + } ); insert_action_group( diff --git a/src/app/browser/main/tab/page/navbar.hpp b/src/app/browser/main/tab/page/navbar.hpp index ea8f320c..249f847d 100644 --- a/src/app/browser/main/tab/page/navbar.hpp +++ b/src/app/browser/main/tab/page/navbar.hpp @@ -5,7 +5,6 @@ #include #include #include -#include #include namespace app::browser::main::tab::page diff --git a/src/main.cpp b/src/main.cpp index d5d5cae4..1dade241 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -20,10 +20,10 @@ int main( app->add_action( "quit", - sigc::mem_fun( - * app, - & Gtk::Application::quit - ) + [app] + { + app->quit(); + } ); // Init accels @TODO db settings