X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=optional%2Fdali-toolkit%2Finternal%2Fcontrols%2Fcluster%2Fcluster-impl.cpp;h=d94a94b737bb85446d0921e6c884b869dc315459;hp=fa9ee423a05bf8478eaca39fd0a402aa84e1fa70;hb=4c9e3c8180e813f24d7514b275abd0d79c155405;hpb=e5f2603c45d9423cd45e4708a969eb05b982bfd9 diff --git a/optional/dali-toolkit/internal/controls/cluster/cluster-impl.cpp b/optional/dali-toolkit/internal/controls/cluster/cluster-impl.cpp index fa9ee42..d94a94b 100644 --- a/optional/dali-toolkit/internal/controls/cluster/cluster-impl.cpp +++ b/optional/dali-toolkit/internal/controls/cluster/cluster-impl.cpp @@ -26,6 +26,7 @@ // INTERNAL INCLUDES #include +#include using namespace Dali; @@ -92,6 +93,27 @@ void Cluster::OnInitialize() { } +void Cluster::OnControlSizeSet( const Vector3& targetSize ) +{ + mClusterSize = targetSize; + GetImpl(mClusterStyle).SetClusterSize(targetSize); + + for(ChildInfoIter iter = mChildren.begin(); iter != mChildren.end(); ++iter) + { + + if((*iter).mActor) + { + mClusterStyle.ApplyStyle( (*iter).mActor, + (*iter).mPositionIndex, + AlphaFunctions::EaseOut, + 0.f ); + } + } + + UpdateBackground(0.f); + UpdateTitle(0.f); +} + Cluster::~Cluster() { } @@ -389,6 +411,7 @@ void Cluster::SetStyle(Toolkit::ClusterStyle style) { unsigned int previousChildrenNum = mChildren.size(); mClusterStyle = style; + GetImpl(mClusterStyle).SetClusterSize(mClusterSize); unsigned int newChildrenNum = mClusterStyle.GetMaximumNumberOfChildren(); // New style supports less children (remove those that no longer belong) @@ -406,14 +429,12 @@ void Cluster::SetStyle(Toolkit::ClusterStyle style) mChildren.erase( removeStart, mChildren.end() ); } - // Remove constraints from previous style, and apply new style's constraints. for(ChildInfoIter iter = mChildren.begin(); iter != mChildren.end(); ++iter) { if((*iter).mActor) { - (*iter).mActor.RemoveConstraints(); - style.ApplyStyle( (*iter).mActor, + mClusterStyle.ApplyStyle( (*iter).mActor, (*iter).mPositionIndex, AlphaFunctions::EaseOut, CLUSTER_STYLE_CONSTRAINT_DURATION ); @@ -443,7 +464,6 @@ void Cluster::UpdateBackground(float duration) { if (mBackgroundImage) { - mBackgroundImage.RemoveConstraints(); mClusterStyle.ApplyStyleToBackground(mBackgroundImage, AlphaFunctions::EaseOut, duration); } } @@ -452,7 +472,6 @@ void Cluster::UpdateTitle(float duration) { if (mTitle) { - mTitle.RemoveConstraints(); mClusterStyle.ApplyStyleToTitle(mTitle, AlphaFunctions::EaseOut, duration); } }