mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:27:43 +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
|
@ -45,6 +45,7 @@ public:
|
||||||
{
|
{
|
||||||
m_guides.remove_first_matching([&](auto& entry) { return &guide == entry.ptr(); });
|
m_guides.remove_first_matching([&](auto& entry) { return &guide == entry.ptr(); });
|
||||||
}
|
}
|
||||||
|
void clear_guides() { m_guides.clear(); }
|
||||||
|
|
||||||
void layers_did_change();
|
void layers_did_change();
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
|
* Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
|
||||||
* Copyright (c) 2021, Mustafa Quraish <mustafa@cs.toronto.edu>
|
* Copyright (c) 2021, Mustafa Quraish <mustafa@cs.toronto.edu>
|
||||||
|
* Copyright (c) 2021, Tobias Christiansen <tobyase@serenityos.org>
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: BSD-2-Clause
|
* 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_add_guide_action);
|
||||||
view_menu.add_action(*m_show_guides_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");
|
auto& tool_menu = window.add_menu("&Tool");
|
||||||
m_toolbox->for_each_tool([&](auto& tool) {
|
m_toolbox->for_each_tool([&](auto& tool) {
|
||||||
if (tool.action())
|
if (tool.action())
|
||||||
|
@ -818,5 +825,4 @@ void MainWidget::drop_event(GUI::DropEvent& event)
|
||||||
open_image_fd(*result.fd, *result.chosen_file);
|
open_image_fd(*result.fd, *result.chosen_file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue