diff options
Diffstat (limited to 'src/Authoring/Studio/Palettes/TimelineGraphicsView/ui')
4 files changed, 16 insertions, 27 deletions
diff --git a/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTree.cpp b/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTree.cpp index 33885f40..6c0f3696 100644 --- a/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTree.cpp +++ b/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTree.cpp @@ -164,9 +164,9 @@ void RowTree::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, Q // update button bounds rects m_rectArrow .setRect(offset, iconY, iconSize, iconSize); m_rectType .setRect(offset + iconSize, iconY, iconSize, iconSize); - m_rectShy .setRect(m_treeWidth - 16 * 3.3, iconY, iconSize, iconSize); - m_rectVisible.setRect(m_treeWidth - 16 * 2.2, iconY, iconSize, iconSize); - m_rectLocked .setRect(m_treeWidth - 16 * 1.1, iconY, iconSize, iconSize); + m_rectShy .setRect(treeWidth() - 16 * 3.3, iconY, iconSize, iconSize); + m_rectVisible.setRect(treeWidth() - 16 * 2.2, iconY, iconSize, iconSize); + m_rectLocked .setRect(treeWidth() - 16 * 1.1, iconY, iconSize, iconSize); // Background QColor bgColor; @@ -275,7 +275,7 @@ void RowTree::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, Q painter->drawPixmap(m_rectType, pixRowType); // Shy, eye, lock separator - painter->fillRect(QRect(m_treeWidth - TimelineConstants::TREE_ICONS_W, + painter->fillRect(QRect(treeWidth() - TimelineConstants::TREE_ICONS_W, 0, 1, size().height()), TimelineConstants::WIDGET_BG_COLOR); @@ -293,7 +293,7 @@ void RowTree::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, Q // Candidate parent of a dragged row if (m_moveTarget) { painter->setPen(QPen(QColor(TimelineConstants::ROW_MOVER_COLOR), 1)); - painter->drawRect(QRect(1, 1, m_treeWidth - 2, size().height() - 3)); + painter->drawRect(QRect(1, 1, treeWidth() - 2, size().height() - 3)); } // Action indicators @@ -328,13 +328,7 @@ void RowTree::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, Q int RowTree::treeWidth() const { - return m_treeWidth; -} - -void RowTree::setTreeWidth(double w) -{ - m_treeWidth = w; - update(); + return m_scene->treeWidth(); } void RowTree::setBinding(ITimelineItemBinding *binding) diff --git a/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTree.h b/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTree.h index 7cd7b979..baa0118f 100644 --- a/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTree.h +++ b/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTree.h @@ -135,7 +135,6 @@ private: int m_depth = 1; int m_index = 0; int m_indexInLayout = 1; - int m_treeWidth = TimelineConstants::TREE_DEFAULT_W; bool m_shy = false; bool m_visible = true; bool m_locked = false; diff --git a/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/TreeHeader.cpp b/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/TreeHeader.cpp index bd375e2a..79321737 100644 --- a/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/TreeHeader.cpp +++ b/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/TreeHeader.cpp @@ -31,7 +31,9 @@ #include <QtGui/qpainter.h> -TreeHeader::TreeHeader(TimelineItem *parent) : TimelineItem(parent) +TreeHeader::TreeHeader(TimelineGraphicsScene *timelineScene, TimelineItem *parent) + : TimelineItem(parent) + , m_scene(timelineScene) { } @@ -42,9 +44,10 @@ void TreeHeader::paint(QPainter *painter, const QStyleOptionGraphicsItem *option Q_UNUSED(option) Q_UNUSED(widget) - m_rectShy .setRect(m_treeWidth - 16 * 3.3, size().height() * .5 - 8, 16, 16); - m_rectVisible.setRect(m_treeWidth - 16 * 2.2, size().height() * .5 - 8, 16, 16); - m_rectLock .setRect(m_treeWidth - 16 * 1.1, size().height() * .5 - 8, 16, 16); + double treeWidth = m_scene->treeWidth(); + m_rectShy .setRect(treeWidth - 16 * 3.3, size().height() * .5 - 8, 16, 16); + m_rectVisible.setRect(treeWidth - 16 * 2.2, size().height() * .5 - 8, 16, 16); + m_rectLock .setRect(treeWidth - 16 * 1.1, size().height() * .5 - 8, 16, 16); static const QPixmap pixShy = QPixmap(":/images/Toggle-Shy.png"); static const QPixmap pixVisible = QPixmap(":/images/Toggle-HideShow.png"); @@ -65,12 +68,6 @@ void TreeHeader::paint(QPainter *painter, const QStyleOptionGraphicsItem *option painter->drawPixmap(m_rectLock , pixLock); } -void TreeHeader::setWidth(double w) -{ - m_treeWidth = w; - update(); -} - TreeControlType TreeHeader::handleButtonsClick(const QPointF &scenePos) { QPointF p = mapFromScene(scenePos.x(), scenePos.y()); diff --git a/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/TreeHeader.h b/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/TreeHeader.h index 88239215..7bd09634 100644 --- a/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/TreeHeader.h +++ b/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/TreeHeader.h @@ -32,6 +32,7 @@ #include "TimelineItem.h" #include "TimelineConstants.h" #include "RowTypes.h" +#include "TimelineGraphicsScene.h" class RowTimeline; @@ -40,24 +41,22 @@ class TreeHeader : public TimelineItem Q_OBJECT public: - explicit TreeHeader(TimelineItem *parent = nullptr); + explicit TreeHeader(TimelineGraphicsScene *timelineScene, TimelineItem *parent = nullptr); void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override; - void setWidth(double w); TreeControlType handleButtonsClick(const QPointF &scenePos); bool filterShy() const; bool filterHidden() const; bool filterLocked() const; int type() const; - int m_treeWidth = TimelineConstants::TREE_DEFAULT_W; - void toggleFilterShy(); void toggleFilterHidden(); void toggleFilterLocked(); private: + TimelineGraphicsScene *m_scene; bool m_shy = false; bool m_visible = false; bool m_lock = false; |