PixelPaint: Add Menu action/shortcut to close current image tab

Ctrl+W now closes the current Image tab.
This commit is contained in:
Mustafa Quraish 2021-09-06 21:52:19 -04:00 committed by Andreas Kling
parent 255f729c1f
commit 736ab4f83a
Notes: sideshowbarker 2024-07-18 04:30:34 +09:00

View File

@ -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();
}));