handle transition track movement

Only allow transitions to move tracks if their attached blocks are moving
with them.
This commit is contained in:
itsmattkc
2020-01-07 03:06:51 +11:00
parent 2941dbff48
commit e09ff4abf6
4 changed files with 53 additions and 17 deletions
@@ -27,7 +27,8 @@ TimelineViewGhostItem::TimelineViewGhostItem(QGraphicsItem *parent) :
track_adj_(0),
stream_(nullptr),
mode_(Timeline::kNone),
can_have_zero_length_(true)
can_have_zero_length_(true),
can_move_tracks_(true)
{
SetInvisible(false);
}
@@ -50,11 +51,21 @@ TimelineViewGhostItem *TimelineViewGhostItem::FromBlock(Block *block, const Trac
return ghost;
}
bool TimelineViewGhostItem::CanHaveZeroLength()
bool TimelineViewGhostItem::CanHaveZeroLength() const
{
return can_have_zero_length_;
}
bool TimelineViewGhostItem::CanMoveTracks() const
{
return can_move_tracks_;
}
void TimelineViewGhostItem::SetCanMoveTracks(bool e)
{
can_move_tracks_ = e;
}
void TimelineViewGhostItem::SetInvisible(bool invisible)
{
setBrush(Qt::NoBrush);