mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:48:12 +00:00
PixelPaint: Add "Clear Guides" to remove all Guides
This patch adds a "Clear Guides" option to the "View"-menu.
This commit is contained in:
parent
3548b08de2
commit
6f2a016565
2 changed files with 8 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2021, Mustafa Quraish <mustafa@cs.toronto.edu>
|
||||
* Copyright (c) 2021, Tobias Christiansen <tobyase@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -351,6 +352,12 @@ void MainWidget::initialize_menubar(GUI::Window& window)
|
|||
view_menu.add_action(*m_add_guide_action);
|
||||
view_menu.add_action(*m_show_guides_action);
|
||||
|
||||
view_menu.add_action(GUI::Action::create(
|
||||
"Clear Guides", [&](auto&) {
|
||||
if (auto* editor = current_image_editor())
|
||||
editor->clear_guides();
|
||||
}));
|
||||
|
||||
auto& tool_menu = window.add_menu("&Tool");
|
||||
m_toolbox->for_each_tool([&](auto& tool) {
|
||||
if (tool.action())
|
||||
|
@ -818,5 +825,4 @@ void MainWidget::drop_event(GUI::DropEvent& event)
|
|||
open_image_fd(*result.fd, *result.chosen_file);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue