timeline: implemented system of moving selections and making them undoable

This commit is contained in:
itsmattkc
2020-10-03 22:33:10 +10:00
parent dd3d11c7e0
commit 8b4a073f35
7 changed files with 231 additions and 76 deletions
+19
View File
@@ -25,6 +25,7 @@
#include "node/block/transition/transition.h"
#include "node/graph.h"
#include "widget/nodeview/nodeviewundo.h"
#include "widget/timelinewidget/timelinewidget.h"
OLIVE_NAMESPACE_ENTER
@@ -1696,4 +1697,22 @@ void TransitionRemoveCommand::undo_internal()
track_->InvalidateCache(TimeRange(block_->in(), block_->out()), track_->block_input(), track_->block_input());
}
TimelineSetSelectionsCommand::TimelineSetSelectionsCommand(TimelineWidget *timeline, const TimelineWidgetSelections &now, const TimelineWidgetSelections &old, QUndoCommand *parent) :
QUndoCommand(parent),
timeline_(timeline),
old_(old),
now_(now)
{
}
void TimelineSetSelectionsCommand::redo()
{
timeline_->SetSelections(now_);
}
void TimelineSetSelectionsCommand::undo()
{
timeline_->SetSelections(old_);
}
OLIVE_NAMESPACE_EXIT