mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 01:37:34 +00:00
Magnifier: Add 8x magnification and pausing
This adds an option for even more magnification, when you really need to count pixels, as well as pausing the capture by pressing Space and switching between magnification levels with keys 2, 4 & 8.
This commit is contained in:
parent
6bdd62b51b
commit
401ea85655
3 changed files with 23 additions and 3 deletions
|
@ -56,24 +56,39 @@ int main(int argc, char** argv)
|
|||
auto size_action_group = make<GUI::ActionGroup>();
|
||||
|
||||
auto two_x_action = GUI::Action::create_checkable(
|
||||
"&2x", [&](auto&) {
|
||||
"&2x", { Key_2 }, [&](auto&) {
|
||||
magnifier.set_scale_factor(2);
|
||||
});
|
||||
|
||||
auto four_x_action = GUI::Action::create_checkable(
|
||||
"&4x", [&](auto&) {
|
||||
"&4x", { Key_4 }, [&](auto&) {
|
||||
magnifier.set_scale_factor(4);
|
||||
});
|
||||
|
||||
auto eight_x_action = GUI::Action::create_checkable(
|
||||
"&8x", { Key_8 }, [&](auto&) {
|
||||
magnifier.set_scale_factor(8);
|
||||
});
|
||||
|
||||
auto pause_action = GUI::Action::create_checkable(
|
||||
"&Pause Capture", { Key_Space }, [&](auto& action) {
|
||||
magnifier.pause_capture(action.is_checked());
|
||||
});
|
||||
|
||||
size_action_group->add_action(two_x_action);
|
||||
size_action_group->add_action(four_x_action);
|
||||
size_action_group->add_action(eight_x_action);
|
||||
size_action_group->set_exclusive(true);
|
||||
|
||||
auto& view_menu = window->add_menu("&View");
|
||||
view_menu.add_action(two_x_action);
|
||||
view_menu.add_action(four_x_action);
|
||||
view_menu.add_action(eight_x_action);
|
||||
two_x_action->set_checked(true);
|
||||
|
||||
view_menu.add_separator();
|
||||
view_menu.add_action(pause_action);
|
||||
|
||||
auto& help_menu = window->add_menu("&Help");
|
||||
help_menu.add_action(GUI::CommonActions::make_about_action("Magnifier", app_icon, window));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue