X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fevent%2Factors%2Factor-impl.cpp;h=f7df4d42aafd6e84a51ca792c3d2bafb2f594f18;hb=d08c943f03a8d4a6e76cfcf789048975a861b678;hp=5a97133bf52ffe09fd209282b9f7dcd7568bdf56;hpb=b32143d912a64d817c93c7a3201d4eba02186942;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/event/actors/actor-impl.cpp b/dali/internal/event/actors/actor-impl.cpp index 5a97133..f7df4d4 100644 --- a/dali/internal/event/actors/actor-impl.cpp +++ b/dali/internal/event/actors/actor-impl.cpp @@ -213,7 +213,7 @@ DALI_PROPERTY( "opacity", FLOAT, true, true, true, Dali: DALI_PROPERTY( "screenPosition", VECTOR2, false, false, false, Dali::DevelActor::Property::SCREEN_POSITION ) DALI_PROPERTY( "positionUsesAnchorPoint", BOOLEAN, true, false, false, Dali::DevelActor::Property::POSITION_USES_ANCHOR_POINT ) DALI_PROPERTY( "layoutDirection", STRING, true, false, false, Dali::DevelActor::Property::LAYOUT_DIRECTION ) -DALI_PROPERTY( "layoutDirectionInheritance", BOOLEAN, true, false, false, Dali::DevelActor::Property::LAYOUT_DIRECTION_INHERITANCE ) +DALI_PROPERTY( "inheritLayoutDirection", BOOLEAN, true, false, false, Dali::DevelActor::Property::INHERIT_LAYOUT_DIRECTION ) DALI_PROPERTY_TABLE_END( DEFAULT_ACTOR_PROPERTY_START_INDEX ) // Signals @@ -2124,7 +2124,7 @@ Actor::Actor( DerivedType derivedType ) mInheritScale( true ), mPositionUsesAnchorPoint( true ), mVisible( true ), - mLayoutDirectionInheritance( true ), + mInheritLayoutDirection( true ), mLayoutDirection( DevelActor::LayoutDirection::LTR ), mDrawMode( DrawMode::NORMAL ), mPositionInheritanceMode( Node::DEFAULT_POSITION_INHERITANCE_MODE ), @@ -2887,24 +2887,21 @@ void Actor::SetDefaultProperty( Property::Index index, const Property::Value& pr case Dali::DevelActor::Property::LAYOUT_DIRECTION: { Dali::DevelActor::LayoutDirection::Type direction = mLayoutDirection; - bool flag = false; if( Scripting::GetEnumerationProperty< DevelActor::LayoutDirection::Type >( property, LAYOUT_DIRECTION_TABLE, LAYOUT_DIRECTION_TABLE_COUNT, direction ) ) { - flag = mLayoutDirectionInheritance; - mLayoutDirectionInheritance = true; - InheritLayoutDirectionRecursively( this, direction ); - mLayoutDirectionInheritance = flag; + mInheritLayoutDirection = false; + InheritLayoutDirectionRecursively( this, direction, true ); } break; } - case Dali::DevelActor::Property::LAYOUT_DIRECTION_INHERITANCE: + case Dali::DevelActor::Property::INHERIT_LAYOUT_DIRECTION: { bool value = false; - if( property.Get( value ) && value != mLayoutDirectionInheritance ) + if( property.Get( value ) ) { - mLayoutDirectionInheritance = value; + SetInheritLayoutDirection( value ); } break; } @@ -4153,13 +4150,13 @@ bool Actor::GetCachedPropertyValue( Property::Index index, Property::Value& valu case Dali::DevelActor::Property::LAYOUT_DIRECTION: { - value = Scripting::GetLinearEnumerationName< DevelActor::LayoutDirection::Type >( mLayoutDirection, LAYOUT_DIRECTION_TABLE, LAYOUT_DIRECTION_TABLE_COUNT ); + value = mLayoutDirection; break; } - case Dali::DevelActor::Property::LAYOUT_DIRECTION_INHERITANCE: + case Dali::DevelActor::Property::INHERIT_LAYOUT_DIRECTION: { - value = mLayoutDirectionInheritance; + value = IsLayoutDirectionInherited(); break; } @@ -5333,9 +5330,27 @@ void Actor::LowerBelow( Internal::Actor& target ) } } -void Actor::InheritLayoutDirectionRecursively( ActorPtr actor, Dali::DevelActor::LayoutDirection::Type direction ) +void Actor::SetInheritLayoutDirection( bool inherit ) { - if( actor && actor->mLayoutDirectionInheritance ) + if( mInheritLayoutDirection != inherit ) + { + mInheritLayoutDirection = inherit; + + if( inherit && mParent ) + { + InheritLayoutDirectionRecursively( this, mParent->mLayoutDirection ); + } + } +} + +bool Actor::IsLayoutDirectionInherited() const +{ + return mInheritLayoutDirection; +} + +void Actor::InheritLayoutDirectionRecursively( ActorPtr actor, Dali::DevelActor::LayoutDirection::Type direction, bool set ) +{ + if( actor && ( actor->mInheritLayoutDirection || set ) ) { if( actor->mLayoutDirection != direction) { @@ -5353,7 +5368,6 @@ void Actor::InheritLayoutDirectionRecursively( ActorPtr actor, Dali::DevelActor: } } } - } } // namespace Internal