#include <dali/public-api/object/type-registry-helper.h>
#include <dali-toolkit/public-api/controls/control.h>
#include <dali-toolkit/devel-api/layouting/layout-item-impl.h>
+#include <dali-toolkit/devel-api/layouting/layout-group-impl.h>
#include <dali-toolkit/internal/layouting/layout-item-data-impl.h>
namespace
{
#if defined(DEBUG_ENABLED)
-Debug::Filter* gLayoutFilter = Debug::Filter::New( Debug::Verbose, false, "LOG_LAYOUT" );
+Debug::Filter* gLayoutFilter = Debug::Filter::New( Debug::NoLogging, false, "LOG_LAYOUT" );
#endif
const char* WIDTH_SPECIFICATION_NAME( "widthSpecification" );
// Enable directly derived types to first remove children
OnUnparent();
+ // Remove myself from parent
+ LayoutParent* parent = GetParent();
+ if( parent )
+ {
+ parent->Remove( *this );
+ }
+
+ // Remove parent reference
+ SetParent(nullptr);
+
// Last, clear owner
mImpl->mOwner = NULL;
}
void LayoutItem::SetAnimateLayout( bool animateLayout )
{
mImpl->mAnimated = animateLayout;
+
+ OnAnimationStateChanged( animateLayout );
}
bool LayoutItem::IsLayoutAnimated() const
const bool needsLayout = specChanged && ( !isSpecExactly || !matchesSpecSize );
+ DALI_LOG_STREAM( gLayoutFilter, Debug::Verbose, "LayoutItem::Measure("<<widthMeasureSpec<<", "<<heightMeasureSpec<<") Owner:"<<Actor::DownCast(GetOwner()).GetName() <<" forceLayout="<<forceLayout<<", specChanged="<<specChanged<<", isSpecExactly="<<isSpecExactly<<", matchesSpecSize="<<matchesSpecSize<<", needsLayout="<<needsLayout <<std::endl <<(forceLayout||needsLayout?" Remeasuring":" NoChange"));
+
if( forceLayout || needsLayout )
{
mImpl->ClearPrivateFlag( Impl::PRIVATE_FLAG_MEASURED_DIMENSION_SET );
// measure ourselves, this should set the measured dimension flag back
+#if defined(DEBUG_ENABLED)
+ std::ostringstream o;
+ o<<widthMeasureSpec<<","<<heightMeasureSpec;
+ DALI_LOG_INFO( gLayoutFilter, Debug::Concise, "Calling %s OnMeasure( %s )\n", Actor::DownCast(GetOwner()).GetName().c_str(), o.str().c_str());
+#endif
OnMeasure( widthMeasureSpec, heightMeasureSpec );
mImpl->ClearPrivateFlag( Impl::PRIVATE_FLAG_MEASURE_NEEDED_BEFORE_LAYOUT );
{
}
+void LayoutItem::SetParent( LayoutParent* parent )
+{
+ mImpl->mLayoutParent = parent;
+}
+
LayoutParent* LayoutItem::GetParent()
{
return mImpl->mLayoutParent;
void LayoutItem::SetLayoutRequested()
{
- return mImpl->SetPrivateFlag( Impl::PRIVATE_FLAG_FORCE_LAYOUT );
+ mImpl->SetPrivateFlag( Impl::PRIVATE_FLAG_FORCE_LAYOUT );
}
void LayoutItem::SetMeasuredDimensions( MeasuredSize measuredWidth, MeasuredSize measuredHeight )
{
bool changed = false;
- DALI_LOG_INFO( gLayoutFilter, Debug::Verbose, "LayoutItem::SetFrame(%d, %d, %d, %d)\n", left.mValue, top.mValue, right.mValue, bottom.mValue );
+ DALI_LOG_INFO( gLayoutFilter, Debug::Verbose, "LayoutItem::SetFrame enter(%d, %d, %d, %d)\n", left.mValue, top.mValue, right.mValue, bottom.mValue );
if( mImpl->mLeft != left || mImpl->mRight != right || mImpl->mTop != top || mImpl->mBottom != bottom )
{
SizeChange( LayoutSize( newWidth, newHeight ), LayoutSize( oldWidth, oldHeight ) );
}
}
+
+ DALI_LOG_INFO( gLayoutFilter, Debug::Verbose, "LayoutItem::SetFrame exit(%d, %d, %d, %d)\n", left.mValue, top.mValue, right.mValue, bottom.mValue );
+
return changed;
}