summaryrefslogtreecommitdiffstats
path: root/src/Authoring/Studio/Palettes/TimelineGraphicsView/RowMover.cpp
diff options
context:
space:
mode:
authorMahmoud Badri <mahmoud.badri@qt.io>2018-02-27 14:37:41 +0200
committerMahmoud Badri <mahmoud.badri@qt.io>2018-03-19 09:03:27 +0000
commit089ab17e462646dcd9edf785aa6850ad92b3a8e0 (patch)
treea58f0c08022bb2ca1a0dae672ff796dd1a7a62ac /src/Authoring/Studio/Palettes/TimelineGraphicsView/RowMover.cpp
parent6741e0b808aef4992c81df1128b8db0f8113f49f (diff)
Continue timeline work
Split timeline and tree views, implement layer locking, filter rows, start connection to the app data mode. Task-number: QT3DS-1262 Change-Id: I54fb659e5c4f1103b8cf792b04bcaf012779cf1a Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Diffstat (limited to 'src/Authoring/Studio/Palettes/TimelineGraphicsView/RowMover.cpp')
-rw-r--r--src/Authoring/Studio/Palettes/TimelineGraphicsView/RowMover.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/Authoring/Studio/Palettes/TimelineGraphicsView/RowMover.cpp b/src/Authoring/Studio/Palettes/TimelineGraphicsView/RowMover.cpp
index ed447bb7..44a521dd 100644
--- a/src/Authoring/Studio/Palettes/TimelineGraphicsView/RowMover.cpp
+++ b/src/Authoring/Studio/Palettes/TimelineGraphicsView/RowMover.cpp
@@ -37,14 +37,20 @@
RowMover::RowMover() : QGraphicsRectItem()
{
setZValue(99);
- setRect(0, -2, 20, 2);
+ setRect(0, -5, TimelineConstants::TREE_MAX_W, 10);
}
void RowMover::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
+ painter->save();
+
+ painter->setPen(QPen(QColor(TimelineConstants::ROW_MOVER_COLOR), 1));
+ painter->drawLine(0, -1, TimelineConstants::TREE_BOUND_W, -1);
+
painter->setPen(QPen(QColor(TimelineConstants::ROW_MOVER_COLOR), 4));
- painter->drawLine(0, -.5, 10, -.5);
- painter->fillRect(0, -2.5, rect().width() - x(), 2, QColor(TimelineConstants::ROW_MOVER_COLOR));
+ painter->drawLine(0, -2, 5, -2);
+
+ painter->restore();
}
RowTree *RowMover::insertionParent() const
@@ -123,7 +129,7 @@ void RowMover::updateState(int index, int depth, int rawIndex)
{
m_targetIndex = index;
- setPos(20 + depth * 15, (rawIndex + 1) * TimelineConstants::ROW_H);
+ setPos(25 + depth * 15, (rawIndex + 1) * TimelineConstants::ROW_H);
setVisible(true);
}
@@ -135,10 +141,9 @@ bool RowMover::isValidMove(int index, RowTree *rowAtIndex)
//index != m_currentIndex &&
// not moving an ancestor into a decendent
- !rowAtIndex->isDecendentOf(m_sourceRow) &&
+ !rowAtIndex->isDecendentOf(m_sourceRow)
// not at the top of an expanded object with property children
- (rowAtIndex->childRows().empty()
- || rowAtIndex->childRows().first()->rowType() != RowType::Property
- || !rowAtIndex->expanded());
+ && (rowAtIndex->childRows().empty() || !rowAtIndex->childRows().first()->isProperty()
+ || !rowAtIndex->expanded());
}