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);
@@ -44,7 +44,10 @@ public:
static TimelineViewGhostItem* FromBlock(Block *block, const TrackReference &track, int y, int height);
bool CanHaveZeroLength();
bool CanHaveZeroLength() const;
bool CanMoveTracks() const;
void SetCanMoveTracks(bool e);
void SetInvisible(bool invisible);
@@ -99,6 +102,7 @@ private:
Timeline::MovementMode mode_;
bool can_have_zero_length_;
bool can_move_tracks_;
};
#endif // TIMELINEVIEWGHOSTITEM_H