diff --git a/Applications/Browser/WindowActions.cpp b/Applications/Browser/WindowActions.cpp index e5169ea7b84..99f0bc8654d 100644 --- a/Applications/Browser/WindowActions.cpp +++ b/Applications/Browser/WindowActions.cpp @@ -21,6 +21,20 @@ WindowActions::WindowActions(GUI::Window& window) on_create_new_tab(); }, &window); + + m_next_tab_action = GUI::Action::create( + "Next tab", { Mod_Ctrl, Key_PageDown }, [this](auto&) { + if (on_next_tab) + on_next_tab(); + }, + &window); + + m_previous_tab_action = GUI::Action::create( + "Previous tab", { Mod_Ctrl, Key_PageUp }, [this](auto&) { + if (on_previous_tab) + on_previous_tab(); + }, + &window); } } diff --git a/Applications/Browser/WindowActions.h b/Applications/Browser/WindowActions.h index 8b64fa2fe9e..0ae2e1a64e7 100644 --- a/Applications/Browser/WindowActions.h +++ b/Applications/Browser/WindowActions.h @@ -11,11 +11,17 @@ public: WindowActions(GUI::Window&); Function on_create_new_tab; + Function on_next_tab; + Function on_previous_tab; GUI::Action& create_new_tab_action() { return *m_create_new_tab_action; } + GUI::Action& next_tab_action() { return *m_next_tab_action; } + GUI::Action& previous_tab_action() { return *m_previous_tab_action; } private: RefPtr m_create_new_tab_action; + RefPtr m_next_tab_action; + RefPtr m_previous_tab_action; }; } diff --git a/Applications/Browser/main.cpp b/Applications/Browser/main.cpp index 16502bc97fa..6bc9f1b9075 100644 --- a/Applications/Browser/main.cpp +++ b/Applications/Browser/main.cpp @@ -131,6 +131,14 @@ int main(int argc, char** argv) create_new_tab(); }; + window_actions.on_next_tab = [&] { + tab_widget.activate_next_tab(); + }; + + window_actions.on_previous_tab = [&] { + tab_widget.activate_previous_tab(); + }; + create_new_tab(); return app.exec();