// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/cluster/cluster-style.h>
+#include <dali-toolkit/internal/controls/cluster/cluster-style-impl.h>
using namespace Dali;
{
}
+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()
{
}
{
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)
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 );
{
if (mBackgroundImage)
{
- mBackgroundImage.RemoveConstraints();
mClusterStyle.ApplyStyleToBackground(mBackgroundImage, AlphaFunctions::EaseOut, duration);
}
}
{
if (mTitle)
{
- mTitle.RemoveConstraints();
mClusterStyle.ApplyStyleToTitle(mTitle, AlphaFunctions::EaseOut, duration);
}
}