Skip to content

Commit 5713317

Browse files
Amogh-2404nico
authored andcommitted
PixelPaint: Add "Change Levels..." menu entry to Image menu
This adds the "Change Levels..." action to the Image menu in PixelPaint, making it more discoverable alongside other image adjustment features. The action was previously only accessible via the toolbar or keyboard shortcut (Ctrl+L). Fixes #26183
1 parent fc2e3fd commit 5713317

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

Userland/Applications/PixelPaint/MainWidget.cpp

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,18 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
735735
editor->did_complete_action("Crop Image to Content"sv);
736736
}));
737737

738+
m_image_menu->add_separator();
739+
740+
m_levels_dialog_action = GUI::Action::create(
741+
"Change &Levels...", { Mod_Ctrl, Key_L }, g_icon_bag.levels, [&](auto&) {
742+
auto* editor = current_image_editor();
743+
VERIFY(editor);
744+
auto dialog = PixelPaint::LevelsDialog::construct(&window, editor);
745+
if (dialog->exec() != GUI::Dialog::ExecResult::OK)
746+
dialog->revert_possible_changes();
747+
});
748+
m_image_menu->add_action(*m_levels_dialog_action);
749+
738750
m_layer_menu = window.add_menu("&Layer"_string);
739751

740752
m_layer_menu->on_visibility_change = [this](bool visible) {
@@ -1193,15 +1205,6 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
11931205
}));
11941206
help_menu->add_action(GUI::CommonActions::make_about_action("Pixel Paint"_string, GUI::Icon::default_icon("app-pixel-paint"sv), &window));
11951207

1196-
m_levels_dialog_action = GUI::Action::create(
1197-
"Change &Levels...", { Mod_Ctrl, Key_L }, g_icon_bag.levels, [&](auto&) {
1198-
auto* editor = current_image_editor();
1199-
VERIFY(editor);
1200-
auto dialog = PixelPaint::LevelsDialog::construct(&window, editor);
1201-
if (dialog->exec() != GUI::Dialog::ExecResult::OK)
1202-
dialog->revert_possible_changes();
1203-
});
1204-
12051208
auto& toolbar = *find_descendant_of_type_named<GUI::Toolbar>("toolbar");
12061209
toolbar.add_action(*m_new_image_action);
12071210
toolbar.add_action(*m_open_image_action);

0 commit comments

Comments
 (0)