Skip to content

Commit

Permalink
[Synfig Studio] Implemented toggle animate hotkey (#2033)
Browse files Browse the repository at this point in the history
  • Loading branch information
Keyikedalube authored Feb 26, 2021
1 parent bbdd853 commit 505d8c5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions synfig-studio/src/gui/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1340,6 +1340,7 @@ DEFINE_ACTION("keyframe-properties", _("Properties"))
{"<Control>0", "<Actions>/canvasview/canvas-zoom-fit-2"},
{"space", "<Actions>/canvasview/play"},
{"space", "<Actions>/canvasview/pause"},
{"<Control>space", "<Actions>/canvasview/animate"},
};

for (const auto& accel_item : default_accel_map) {
Expand Down
5 changes: 5 additions & 0 deletions synfig-studio/src/gui/canvasview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -896,6 +896,11 @@ CanvasView::create_time_bar()
animatebutton = Gtk::manage(new class Gtk::ToggleButton());
animatebutton->set_tooltip_text(_("Turn on animate editing mode"));
icon->show();

// Set hotkey to toggle animate button on and off
auto accel_group = App::ui_manager()->get_accel_group();
animatebutton->set_accel_path("<Actions>/canvasview/animate", accel_group);

animatebutton->add(*icon);
animatebutton->signal_toggled().connect(sigc::mem_fun(*this, &CanvasView::toggle_animatebutton));
animatebutton->set_relief(Gtk::RELIEF_NONE);
Expand Down

0 comments on commit 505d8c5

Please sign in to comment.