mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:27:45 +00:00
PixelPaint: Add menu action to toggle pixel grid visibility
You can now toggle on/off the visibility of the pixel grid from the View menu, if you don't want it shown for some reason.
This commit is contained in:
parent
4af0a99634
commit
79bcb90887
3 changed files with 24 additions and 1 deletions
|
@ -357,6 +357,15 @@ void MainWidget::initialize_menubar(GUI::Window& window)
|
|||
if (auto* editor = current_image_editor())
|
||||
editor->clear_guides();
|
||||
}));
|
||||
view_menu.add_separator();
|
||||
|
||||
auto show_pixel_grid_action = GUI::Action::create_checkable(
|
||||
"Show Pixel Grid", [&](auto& action) {
|
||||
if (auto* editor = current_image_editor())
|
||||
editor->set_pixel_grid_visibility(action.is_checked());
|
||||
});
|
||||
show_pixel_grid_action->set_checked(true);
|
||||
view_menu.add_action(*show_pixel_grid_action);
|
||||
|
||||
auto& tool_menu = window.add_menu("&Tool");
|
||||
m_toolbox->for_each_tool([&](auto& tool) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue