diff --git a/Userland/Applications/PixelPaint/ImageEditor.h b/Userland/Applications/PixelPaint/ImageEditor.h index edd8dac642..62b5691b68 100644 --- a/Userland/Applications/PixelPaint/ImageEditor.h +++ b/Userland/Applications/PixelPaint/ImageEditor.h @@ -45,6 +45,7 @@ public: { m_guides.remove_first_matching([&](auto& entry) { return &guide == entry.ptr(); }); } + void clear_guides() { m_guides.clear(); } void layers_did_change(); diff --git a/Userland/Applications/PixelPaint/MainWidget.cpp b/Userland/Applications/PixelPaint/MainWidget.cpp index aebcb1ef37..e8ddd0b5a2 100644 --- a/Userland/Applications/PixelPaint/MainWidget.cpp +++ b/Userland/Applications/PixelPaint/MainWidget.cpp @@ -1,6 +1,7 @@ /* * Copyright (c) 2018-2021, Andreas Kling * Copyright (c) 2021, Mustafa Quraish + * Copyright (c) 2021, Tobias Christiansen * * 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); } } - }