X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fflex-container%2Fflex-container-impl.cpp;h=c520ede1bb9e4eb0cc0d47b471d281cedd0991b5;hb=ad2c68be894854b5dd91295039afebc21e659c3a;hp=88724e00e4a1a47e6eaba551d37489a24e9a2bab;hpb=e2342ebf88a25b6a8e951070604130262ef11082;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/controls/flex-container/flex-container-impl.cpp b/dali-toolkit/internal/controls/flex-container/flex-container-impl.cpp index 88724e0..c520ede 100644 --- a/dali-toolkit/internal/controls/flex-container/flex-container-impl.cpp +++ b/dali-toolkit/internal/controls/flex-container/flex-container-impl.cpp @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include @@ -600,29 +600,38 @@ void FlexContainer::ComputeLayout() // These properties should be dynamically registered to the child which // would be added to FlexContainer. - childNode->style.flex = childActor.GetProperty( Toolkit::FlexContainer::ChildProperty::FLEX ).Get(); - - Toolkit::FlexContainer::Alignment alignSelf( Toolkit::FlexContainer::ALIGN_AUTO ); - Property::Value alignSelfPropertyValue = childActor.GetProperty( Toolkit::FlexContainer::ChildProperty::ALIGN_SELF ); - if( alignSelfPropertyValue.GetType() == Property::INTEGER ) + if( childActor.GetPropertyType( Toolkit::FlexContainer::ChildProperty::FLEX ) != Property::NONE ) { - alignSelf = static_cast( alignSelfPropertyValue.Get< int >() ); + childNode->style.flex = childActor.GetProperty( Toolkit::FlexContainer::ChildProperty::FLEX ).Get(); } - else if( alignSelfPropertyValue.GetType() == Property::STRING ) + + Toolkit::FlexContainer::Alignment alignSelf( Toolkit::FlexContainer::ALIGN_AUTO ); + if( childActor.GetPropertyType( Toolkit::FlexContainer::FlexContainer::ChildProperty::ALIGN_SELF ) != Property::NONE ) { - std::string value = alignSelfPropertyValue.Get(); - Scripting::GetEnumeration< Toolkit::FlexContainer::Alignment >( value.c_str(), - ALIGN_SELF_STRING_TABLE, - ALIGN_SELF_STRING_TABLE_COUNT, - alignSelf ); + Property::Value alignSelfPropertyValue = childActor.GetProperty( Toolkit::FlexContainer::ChildProperty::ALIGN_SELF ); + if( alignSelfPropertyValue.GetType() == Property::INTEGER ) + { + alignSelf = static_cast( alignSelfPropertyValue.Get< int >() ); + } + else if( alignSelfPropertyValue.GetType() == Property::STRING ) + { + std::string value = alignSelfPropertyValue.Get(); + Scripting::GetEnumeration< Toolkit::FlexContainer::Alignment >( value.c_str(), + ALIGN_SELF_STRING_TABLE, + ALIGN_SELF_STRING_TABLE_COUNT, + alignSelf ); + } } childNode->style.align_self = static_cast(alignSelf); - Vector4 flexMargin = childActor.GetProperty( Toolkit::FlexContainer::ChildProperty::FLEX_MARGIN ).Get(); - childNode->style.margin[CSS_LEFT] = flexMargin.x; - childNode->style.margin[CSS_TOP] = flexMargin.y; - childNode->style.margin[CSS_RIGHT] = flexMargin.z; - childNode->style.margin[CSS_BOTTOM] = flexMargin.w; + if( childActor.GetPropertyType( Toolkit::FlexContainer::ChildProperty::FLEX_MARGIN ) != Property::NONE ) + { + Vector4 flexMargin = childActor.GetProperty( Toolkit::FlexContainer::ChildProperty::FLEX_MARGIN ).Get(); + childNode->style.margin[CSS_LEFT] = flexMargin.x; + childNode->style.margin[CSS_TOP] = flexMargin.y; + childNode->style.margin[CSS_RIGHT] = flexMargin.z; + childNode->style.margin[CSS_BOTTOM] = flexMargin.w; + } } // Calculate the layout @@ -745,7 +754,7 @@ Actor FlexContainer::GetNextKeyboardFocusableActor(Actor currentFocusedActor, To } FlexContainer::FlexContainer() -: Control( ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) ), +: Control( ControlBehaviour( CONTROL_BEHAVIOUR_DEFAULT ) ), mContentDirection( Toolkit::FlexContainer::INHERIT ), mFlexDirection( Toolkit::FlexContainer::COLUMN ), mFlexWrap( Toolkit::FlexContainer::NO_WRAP ),