handle transition track movement
Only allow transitions to move tracks if their attached blocks are moving with them.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user