summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@qt.io>2018-05-04 13:54:41 +0300
committerMiikka Heikkinen <miikka.heikkinen@qt.io>2018-05-07 06:26:53 +0000
commit2483119eaf6c7ab5ea620c2728a7022712103db1 (patch)
treef4f96426f3e7510c0a306503771238b561b207be
parente6e89d6a62deb11d51947e1ae3f391150db407cc (diff)
Update shy/visible/lock indicators on timeline rows properly
Task-number: QT3DS-1517 Change-Id: Ic60559797dbaf5f1b4409e183dda319f3ecdc554 Reviewed-by: Kaj Grönholm <kaj.gronholm@qt.io> Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
-rw-r--r--src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineWidget.cpp20
-rw-r--r--src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTree.cpp25
-rw-r--r--src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTree.h1
3 files changed, 29 insertions, 17 deletions
diff --git a/src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineWidget.cpp b/src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineWidget.cpp
index da3656a3..67f975d5 100644
--- a/src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineWidget.cpp
+++ b/src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineWidget.cpp
@@ -578,13 +578,19 @@ void TimelineWidget::refreshKeyframe(qt3dsdm::Qt3DSDMAnimationHandle inAnimation
void TimelineWidget::onPropertyChanged(qt3dsdm::Qt3DSDMInstanceHandle inInstance,
qt3dsdm::Qt3DSDMPropertyHandle inProperty)
{
- Qt3DSDMTimelineItemBinding *binding = getBindingForHandle(inInstance, m_binding);
-
- if (binding) {
- binding->OnPropertyChanged(inProperty);
-
- if (binding->getRowTree())
- binding->getRowTree()->rowTimeline()->updateDurationFromBinding();
+ const SDataModelSceneAsset &asset = g_StudioApp.GetCore()->GetDoc()->GetStudioSystem()
+ ->GetClientDataModelBridge()->GetSceneAsset();
+ if (inProperty == asset.m_Eyeball || inProperty == asset.m_Locked || inProperty == asset.m_Shy
+ || inProperty == asset.m_StartTime || inProperty == asset.m_EndTime) {
+ Qt3DSDMTimelineItemBinding *binding = getBindingForHandle(inInstance, m_binding);
+ if (binding) {
+ binding->OnPropertyChanged(inProperty);
+ RowTree *row = binding->getRowTree();
+ if (row) {
+ row->rowTimeline()->updateDurationFromBinding();
+ row->updateFromBinding();
+ }
+ }
}
}
diff --git a/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTree.cpp b/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTree.cpp
index 6c0f3696..6e8cada3 100644
--- a/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTree.cpp
+++ b/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTree.cpp
@@ -335,16 +335,7 @@ void RowTree::setBinding(ITimelineItemBinding *binding)
{
m_binding = binding;
- // update view (shy, visible, locked)
- m_shy = m_binding->GetTimelineItem()->IsShy();
- m_visible = m_binding->GetTimelineItem()->IsVisible();
- m_locked = m_binding->GetTimelineItem()->IsLocked();
-
- // Update label locking & color
- Qt3DSDMTimelineItemBinding *itemBinding =
- static_cast<Qt3DSDMTimelineItemBinding *>(binding);
- m_labelItem.setLocked(m_locked);
- m_labelItem.setMaster(itemBinding->IsMaster());
+ updateFromBinding();
}
ITimelineItemProperty *RowTree::propBinding()
@@ -595,6 +586,20 @@ void RowTree::updateIndices(bool isInsertion, int index, int indexInLayout, bool
}
}
+void RowTree::updateFromBinding()
+{
+ // update view (shy, visible, locked)
+ m_shy = m_binding->GetTimelineItem()->IsShy();
+ m_visible = m_binding->GetTimelineItem()->IsVisible();
+ m_locked = m_binding->GetTimelineItem()->IsLocked();
+
+ // Update label locking & color
+ Qt3DSDMTimelineItemBinding *itemBinding =
+ static_cast<Qt3DSDMTimelineItemBinding *>(m_binding);
+ m_labelItem.setLocked(m_locked);
+ m_labelItem.setMaster(itemBinding->IsMaster());
+}
+
bool RowTree::hasPropertyChildren() const
{
return !m_childProps.empty();
diff --git a/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTree.h b/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTree.h
index baa0118f..36bd2820 100644
--- a/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTree.h
+++ b/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTree.h
@@ -109,6 +109,7 @@ public:
void toggleShy();
void toggleVisible();
void toggleLocked();
+ void updateFromBinding();
ITimelineItemBinding *getBinding() const;