mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:47:37 +00:00
PixelPaint: Add Image>Resize Image... dialog. (Front end)
This commit is contained in:
parent
abaecb878b
commit
02399d4775
11 changed files with 302 additions and 0 deletions
|
@ -12,6 +12,7 @@
|
|||
#include "EditGuideDialog.h"
|
||||
#include "FilterGallery.h"
|
||||
#include "FilterParams.h"
|
||||
#include "ResizeImageDialog.h"
|
||||
#include <Applications/PixelPaint/PixelPaintWindowGML.h>
|
||||
#include <LibConfig/Client.h>
|
||||
#include <LibCore/File.h>
|
||||
|
@ -499,6 +500,14 @@ void MainWidget::initialize_menubar(GUI::Window& window)
|
|||
editor->image().rotate(Gfx::RotationDirection::Clockwise);
|
||||
}));
|
||||
m_image_menu->add_separator();
|
||||
m_image_menu->add_action(GUI::Action::create(
|
||||
"&Resize Image...", { Mod_Ctrl | Mod_Shift, Key_R }, g_icon_bag.resize_image, [&](auto&) {
|
||||
auto* editor = current_image_editor();
|
||||
VERIFY(editor);
|
||||
auto dialog = PixelPaint::ResizeImageDialog::construct(editor->image().size(), &window);
|
||||
if (dialog->exec() == GUI::Dialog::ExecResult::OK)
|
||||
editor->image().resize(dialog->desired_size(), dialog->scaling_mode());
|
||||
}));
|
||||
m_image_menu->add_action(GUI::Action::create(
|
||||
"&Crop To Selection", g_icon_bag.crop, [&](auto&) {
|
||||
auto* editor = current_image_editor();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue