mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:07:34 +00:00
PixelPaint: Add Menu action/shortcut to close current image tab
Ctrl+W now closes the current Image tab.
This commit is contained in:
parent
255f729c1f
commit
736ab4f83a
1 changed files with 8 additions and 0 deletions
|
@ -162,6 +162,14 @@ void MainWidget::initialize_menubar(GUI::Window& window)
|
|||
}));
|
||||
|
||||
file_menu.add_separator();
|
||||
file_menu.add_action(
|
||||
GUI::Action::create(
|
||||
"&Close Image", { Mod_Ctrl, Key_W }, [&](auto&) {
|
||||
auto* active_widget = m_tab_widget->active_widget();
|
||||
if (!active_widget)
|
||||
return;
|
||||
m_tab_widget->on_tab_close_click(*active_widget);
|
||||
}));
|
||||
file_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) {
|
||||
GUI::Application::the()->quit();
|
||||
}));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue