X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Flayouting%2Fvbox-layout-impl.cpp;h=7e33107aa0ec2c95b62dcbee2709b0cf1f40fa2e;hb=f2608c9be345a239eac3693feb084d51d2a7af11;hp=ceb42c4027e41dfbd422f14f9da53227966224c9;hpb=16634ab902b66b0ba2f3f39af8ff6ed25b5f7115;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/layouting/vbox-layout-impl.cpp b/dali-toolkit/internal/layouting/vbox-layout-impl.cpp old mode 100644 new mode 100755 index ceb42c4..7e33107 --- a/dali-toolkit/internal/layouting/vbox-layout-impl.cpp +++ b/dali-toolkit/internal/layouting/vbox-layout-impl.cpp @@ -17,20 +17,21 @@ //CLASS HEADER #include -//EXTERNAL HEADERS //INTERNAL HEADERS #include #include #include #include -#include +#include #include #include - +namespace +{ #if defined(DEBUG_ENABLED) -static Debug::Filter* gLogFilter = Debug::Filter::New( Debug::Concise, false, "LOG_LAYOUT" ); +static Debug::Filter* gLogFilter = Debug::Filter::New( Debug::NoLogging, false, "LOG_LAYOUT" ); #endif +} namespace Dali { @@ -76,7 +77,7 @@ void VboxLayout::DoRegisterChildProperties( const std::string& containerType ) } } -void VboxLayout::OnChildAdd( LayoutBase& child ) +void VboxLayout::OnChildAdd( LayoutItem& child ) { auto owner = child.GetOwner(); owner.SetProperty( Toolkit::VboxLayout::ChildProperty::WEIGHT, 1.0f ); @@ -128,11 +129,12 @@ void VboxLayout::OnMeasure( MeasureSpec widthMeasureSpec, MeasureSpec heightMeas if( childLayout ) { auto childOwner = childLayout->GetOwner(); - auto desiredWidth = childOwner.GetProperty( Toolkit::LayoutBase::ChildProperty::WIDTH_SPECIFICATION ); + auto desiredWidth = childOwner.GetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION ); MeasureChildWithMargins( childLayout, widthMeasureSpec, 0, heightMeasureSpec, 0 ); auto childHeight = childLayout->GetMeasuredHeight(); - auto childMargin = childOwner.GetProperty( Toolkit::LayoutGroup::ChildProperty::MARGIN_SPECIFICATION ); + auto childMargin = childLayout->GetMargin(); + auto length = childHeight + LayoutLength::IntType(childMargin.top + childMargin.bottom ); auto cellPadding = iGetOwner(); - auto desiredWidth = childOwner.GetProperty( Toolkit::LayoutBase::ChildProperty::WIDTH_SPECIFICATION ); - auto desiredHeight = childOwner.GetProperty( Toolkit::LayoutBase::ChildProperty::HEIGHT_SPECIFICATION ); + auto desiredWidth = childOwner.GetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION ); + auto desiredHeight = childOwner.GetProperty( Toolkit::LayoutItem::ChildProperty::HEIGHT_SPECIFICATION ); if( desiredWidth == Toolkit::ChildLayoutData::MATCH_PARENT ) { // Temporarily force children to reuse their old measured height int oldHeight = desiredHeight; - childOwner.SetProperty( Toolkit::LayoutBase::ChildProperty::HEIGHT_SPECIFICATION, childLayout->GetMeasuredHeight().mValue ); + childOwner.SetProperty( Toolkit::LayoutItem::ChildProperty::HEIGHT_SPECIFICATION, childLayout->GetMeasuredHeight().mValue ); // Remeasure with new dimensions MeasureChildWithMargins( childLayout, uniformMeasureSpec, 0, heightMeasureSpec, 0 ); - childOwner.SetProperty( Toolkit::LayoutBase::ChildProperty::HEIGHT_SPECIFICATION, oldHeight ); + childOwner.SetProperty( Toolkit::LayoutItem::ChildProperty::HEIGHT_SPECIFICATION, oldHeight ); } } } @@ -223,7 +224,6 @@ void VboxLayout::ForceUniformWidth( int count, MeasureSpec heightMeasureSpec ) void VboxLayout::OnLayout( bool changed, LayoutLength left, LayoutLength top, LayoutLength right, LayoutLength bottom ) { - auto owner = GetOwner(); Extents padding = GetPadding(); LayoutLength childTop( 0 ); @@ -233,25 +233,25 @@ void VboxLayout::OnLayout( bool changed, LayoutLength left, LayoutLength top, La auto width = right - left; // Space available for child - auto childSpace = width - padding.start - padding.end; + auto childSpace = width - (int)padding.start - (int)padding.end; auto count = GetChildCount(); for( unsigned int childIndex = 0; childIndex < count; childIndex++) { - LayoutBasePtr childLayout = GetChildAt( childIndex ); + LayoutItemPtr childLayout = GetChildAt( childIndex ); if( childLayout != nullptr ) { auto childWidth = childLayout->GetMeasuredWidth(); auto childHeight = childLayout->GetMeasuredHeight(); auto childOwner = childLayout->GetOwner(); - auto childMargin = childOwner.GetProperty( Toolkit::LayoutGroup::ChildProperty::MARGIN_SPECIFICATION ); + auto childMargin = childLayout->GetMargin(); childTop += childMargin.top; - childLeft = ( childSpace - childWidth ) / 2 + childMargin.start - childMargin.end; + childLeft = ( childSpace - childWidth ) / 2 + (int)childMargin.start - (int)childMargin.end; childLayout->Layout( childLeft, childTop, childLeft + childWidth, childTop + childHeight ); - childTop += childHeight + childMargin.bottom + mCellPadding.height; + childTop += childHeight + (int)childMargin.bottom + mCellPadding.height; } } }