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
mInheritScale( true ),
mPositionUsesAnchorPoint( true ),
mVisible( true ),
- mLayoutDirectionInheritance( true ),
+ mInheritLayoutDirection( true ),
mLayoutDirection( DevelActor::LayoutDirection::LTR ),
mDrawMode( DrawMode::NORMAL ),
mPositionInheritanceMode( Node::DEFAULT_POSITION_INHERITANCE_MODE ),
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;
}
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;
}
}
}
-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)
{
}
}
}
-
}
} // namespace Internal