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=f5b079a3d592d9a35650b757cf77f72b2f168d3a;hb=4c9e3c8180e813f24d7514b275abd0d79c155405;hpb=d5e3ed5f5b1c8fdba3ae97ead8729620f54b3836 diff --git a/optional/dali-toolkit/internal/controls/cluster/cluster-impl.cpp b/optional/dali-toolkit/internal/controls/cluster/cluster-impl.cpp index f5b079a..d94a94b 100644 --- a/optional/dali-toolkit/internal/controls/cluster/cluster-impl.cpp +++ b/optional/dali-toolkit/internal/controls/cluster/cluster-impl.cpp @@ -20,12 +20,14 @@ // EXTERNAL INCLUDES #include +#include +#include #include // INTERNAL INCLUDES #include +#include -using namespace std; using namespace Dali; namespace // unnamed namespace @@ -91,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() { } @@ -139,7 +162,7 @@ void Cluster::AddChildInfoAt( ChildInfo childInfo, unsigned int index ) Property::Index depthProperty = child.GetPropertyIndex(Toolkit::Cluster::CLUSTER_ACTOR_DEPTH); if(depthProperty == Property::INVALID_INDEX) { - depthProperty = child.RegisterProperty(Toolkit::Cluster::CLUSTER_ACTOR_DEPTH, depth); + child.RegisterProperty(Toolkit::Cluster::CLUSTER_ACTOR_DEPTH, depth); } // not added prior @@ -388,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) @@ -405,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 ); @@ -442,7 +464,6 @@ void Cluster::UpdateBackground(float duration) { if (mBackgroundImage) { - mBackgroundImage.RemoveConstraints(); mClusterStyle.ApplyStyleToBackground(mBackgroundImage, AlphaFunctions::EaseOut, duration); } } @@ -451,7 +472,6 @@ void Cluster::UpdateTitle(float duration) { if (mTitle) { - mTitle.RemoveConstraints(); mClusterStyle.ApplyStyleToTitle(mTitle, AlphaFunctions::EaseOut, duration); } } @@ -528,7 +548,7 @@ void Cluster::OnControlChildRemove(Actor& child) child.RemoveConstraints(); } -bool Cluster::DoAction(BaseObject* object, const std::string& actionName, const std::vector& attributes) +bool Cluster::DoAction(BaseObject* object, const std::string& actionName, const PropertyValueContainer& attributes) { bool ret = false;