1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:37:35 +00:00

Browser: Add "Close tab" action (Ctrl+W) :^)

Note that this is a little bit unreliable with the keyboard shortcut
since LibGUI can get confused about which Action it's supposed to use
as each Browser::Tab has its own "close tab" action. This will need
to be fixed in LibGUI.
This commit is contained in:
Andreas Kling 2020-04-23 21:36:17 +02:00
parent 476a4475e5
commit 312501f309
3 changed files with 12 additions and 0 deletions

View file

@ -178,6 +178,9 @@ Tab::Tab()
auto& app_menu = m_menubar->add_menu("Browser");
app_menu.add_action(WindowActions::the().create_new_tab_action());
app_menu.add_action(GUI::Action::create("Close tab", { Mod_Ctrl, Key_W }, [this](auto&) {
on_tab_close_request(*this);
}));
app_menu.add_action(GUI::Action::create("Reload", { Mod_None, Key_F5 }, Gfx::Bitmap::load_from_file("/res/icons/16x16/reload.png"), [this](auto&) {
TemporaryChange<bool> change(m_should_push_loads_to_history, false);