mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-24 02:03:06 -05:00
ImageViewer: Add Smooth Pixels image scaling option
This commit is contained in:
parent
ab6288fd3d
commit
1759d8f34e
Notes:
sideshowbarker
2024-07-17 10:08:46 +09:00
Author: https://github.com/krkk Commit: https://github.com/SerenityOS/serenity/commit/1759d8f34e Pull-request: https://github.com/SerenityOS/serenity/pull/14197
1 changed files with 6 additions and 0 deletions
|
@ -240,6 +240,10 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||||
});
|
});
|
||||||
nearest_neighbor_action->set_checked(true);
|
nearest_neighbor_action->set_checked(true);
|
||||||
|
|
||||||
|
auto smooth_pixels_action = GUI::Action::create_checkable("&Smooth Pixels", [&](auto&) {
|
||||||
|
widget->set_scaling_mode(Gfx::Painter::ScalingMode::SmoothPixels);
|
||||||
|
});
|
||||||
|
|
||||||
auto bilinear_action = GUI::Action::create_checkable("&Bilinear", [&](auto&) {
|
auto bilinear_action = GUI::Action::create_checkable("&Bilinear", [&](auto&) {
|
||||||
widget->set_scaling_mode(Gfx::Painter::ScalingMode::BilinearBlend);
|
widget->set_scaling_mode(Gfx::Painter::ScalingMode::BilinearBlend);
|
||||||
});
|
});
|
||||||
|
@ -314,9 +318,11 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||||
auto scaling_mode_group = make<GUI::ActionGroup>();
|
auto scaling_mode_group = make<GUI::ActionGroup>();
|
||||||
scaling_mode_group->set_exclusive(true);
|
scaling_mode_group->set_exclusive(true);
|
||||||
scaling_mode_group->add_action(*nearest_neighbor_action);
|
scaling_mode_group->add_action(*nearest_neighbor_action);
|
||||||
|
scaling_mode_group->add_action(*smooth_pixels_action);
|
||||||
scaling_mode_group->add_action(*bilinear_action);
|
scaling_mode_group->add_action(*bilinear_action);
|
||||||
|
|
||||||
TRY(scaling_mode_menu->try_add_action(nearest_neighbor_action));
|
TRY(scaling_mode_menu->try_add_action(nearest_neighbor_action));
|
||||||
|
TRY(scaling_mode_menu->try_add_action(smooth_pixels_action));
|
||||||
TRY(scaling_mode_menu->try_add_action(bilinear_action));
|
TRY(scaling_mode_menu->try_add_action(bilinear_action));
|
||||||
|
|
||||||
TRY(view_menu->try_add_separator());
|
TRY(view_menu->try_add_separator());
|
||||||
|
|
Loading…
Add table
Reference in a new issue