mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:57:35 +00:00
Magnifier: Add timeline for easy checking of animations
This patch adds a 512 frame timeline to Magnifier and the ability to step through it with the arrow keys. This makes it easier to check Serenity animations frame by frame for correctness etc.
This commit is contained in:
parent
58ec2f688b
commit
5238308d6f
3 changed files with 44 additions and 1 deletions
|
@ -75,6 +75,22 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
TRY(view_menu->try_add_separator());
|
||||
TRY(view_menu->try_add_action(pause_action));
|
||||
|
||||
auto timeline_menu = TRY(window->try_add_menu("&Timeline"));
|
||||
auto previous_frame_action = GUI::Action::create(
|
||||
"&Previous frame", { Key_Left }, [&](auto&) {
|
||||
pause_action->set_checked(true);
|
||||
magnifier->pause_capture(true);
|
||||
magnifier->display_previous_frame();
|
||||
});
|
||||
auto next_frame_action = GUI::Action::create(
|
||||
"&Next frame", { Key_Right }, [&](auto&) {
|
||||
pause_action->set_checked(true);
|
||||
magnifier->pause_capture(true);
|
||||
magnifier->display_next_frame();
|
||||
});
|
||||
TRY(timeline_menu->try_add_action(previous_frame_action));
|
||||
TRY(timeline_menu->try_add_action(next_frame_action));
|
||||
|
||||
auto help_menu = TRY(window->try_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