DALI_PROPERTY( "maximumSize", VECTOR2, true, false, false, Dali::Actor::Property::MAXIMUM_SIZE )
DALI_PROPERTY( "inheritPosition", BOOLEAN, true, false, false, Dali::Actor::Property::INHERIT_POSITION )
DALI_PROPERTY( "clippingMode", STRING, true, false, false, Dali::Actor::Property::CLIPPING_MODE )
-DALI_PROPERTY( "batchParent", BOOLEAN, true, false, false, Dali::DevelActor::Property::BATCH_PARENT )
DALI_PROPERTY( "siblingOrder", INTEGER, true, false, false, Dali::DevelActor::Property::SIBLING_ORDER )
DALI_PROPERTY_TABLE_END( DEFAULT_ACTOR_PROPERTY_START_INDEX )
{
EnsureRelayoutData();
+ ResizePolicy::Type originalWidthPolicy = GetResizePolicy(Dimension::WIDTH);
+ ResizePolicy::Type originalHeightPolicy = GetResizePolicy(Dimension::HEIGHT);
+
for( unsigned int i = 0; i < Dimension::DIMENSION_COUNT; ++i )
{
if( dimension & ( 1 << i ) )
// If calling SetResizePolicy, assume we want relayout enabled
SetRelayoutEnabled( true );
+ // If the resize policy is set to be FIXED, the preferred size
+ // should be overrided by the target size. Otherwise the target
+ // size should be overrided by the preferred size.
+
+ if( dimension & Dimension::WIDTH )
+ {
+ if( originalWidthPolicy != ResizePolicy::FIXED && policy == ResizePolicy::FIXED )
+ {
+ mRelayoutData->preferredSize.width = mTargetSize.width;
+ }
+ else if( originalWidthPolicy == ResizePolicy::FIXED && policy != ResizePolicy::FIXED )
+ {
+ mTargetSize.width = mRelayoutData->preferredSize.width;
+ }
+ }
+
+ if( dimension & Dimension::HEIGHT )
+ {
+ if( originalHeightPolicy != ResizePolicy::FIXED && policy == ResizePolicy::FIXED )
+ {
+ mRelayoutData->preferredSize.height = mTargetSize.height;
+ }
+ else if( originalHeightPolicy == ResizePolicy::FIXED && policy != ResizePolicy::FIXED )
+ {
+ mTargetSize.height = mRelayoutData->preferredSize.height;
+ }
+ }
+
OnSetResizePolicy( policy, dimension );
// Trigger relayout on this control
mDrawMode( DrawMode::NORMAL ),
mPositionInheritanceMode( Node::DEFAULT_POSITION_INHERITANCE_MODE ),
mColorMode( Node::DEFAULT_COLOR_MODE ),
- mClippingMode( ClippingMode::DISABLED ),
- mIsBatchParent( false )
+ mClippingMode( ClippingMode::DISABLED )
{
}
break;
}
- case Dali::DevelActor::Property::BATCH_PARENT:
- {
- bool value;
-
- if( property.Get( value ) )
- {
- if( value != mIsBatchParent )
- {
- mIsBatchParent = value;
- SetIsBatchParentMessage( GetEventThreadServices(), *mNode, mIsBatchParent );
- }
- }
- break;
- }
-
case Dali::DevelActor::Property::SIBLING_ORDER:
{
int value;
case Dali::Actor::Property::SIZE:
{
- value = GetTargetSize();
+ Vector3 size = GetTargetSize();
+
+ // Should return preferred size if size is fixed as set by SetSize
+ if( GetResizePolicy( Dimension::WIDTH ) == ResizePolicy::FIXED )
+ {
+ size.width = GetPreferredSize().width;
+ }
+ if( GetResizePolicy( Dimension::HEIGHT ) == ResizePolicy::FIXED )
+ {
+ size.height = GetPreferredSize().height;
+ }
+
+ value = size;
+
break;
}
case Dali::Actor::Property::SIZE_WIDTH:
{
- value = GetTargetSize().width;
+ if( GetResizePolicy( Dimension::WIDTH ) == ResizePolicy::FIXED )
+ {
+ // Should return preferred size if size is fixed as set by SetSize
+ value = GetPreferredSize().width;
+ }
+ else
+ {
+ value = GetTargetSize().width;
+ }
break;
}
case Dali::Actor::Property::SIZE_HEIGHT:
{
- value = GetTargetSize().height;
+ if( GetResizePolicy( Dimension::HEIGHT ) == ResizePolicy::FIXED )
+ {
+ // Should return preferred size if size is fixed as set by SetSize
+ value = GetPreferredSize().height;
+ }
+ else
+ {
+ value = GetTargetSize().height;
+ }
break;
}
break;
}
- case Dali::DevelActor::Property::BATCH_PARENT:
- {
- value = mIsBatchParent;
- break;
- }
-
case Dali::DevelActor::Property::SIBLING_ORDER:
{
value = static_cast<int>(mSiblingOrder);