mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-13 11:42:38 +03: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
Notes:
sideshowbarker
2024-07-18 04:30:34 +09:00
Author: https://github.com/mustafaquraish Commit: https://github.com/SerenityOS/serenity/commit/736ab4f83af Pull-request: https://github.com/SerenityOS/serenity/pull/9870
@ -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…
Reference in New Issue
Block a user