X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fevent%2Factors%2Factor-impl.cpp;h=2065436c1f8b373a69c55bd5040273fc8218c353;hb=bbbd986a3779df135740042b07321370deac2ba0;hp=cf4d4ff4204d33c6ced7004ed041c05b158cdb8c;hpb=f19a7cddb14f507038e970b6032a54f86d024639;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 old mode 100755 new mode 100644 index cf4d4ff..2065436 --- a/dali/internal/event/actors/actor-impl.cpp +++ b/dali/internal/event/actors/actor-impl.cpp @@ -214,7 +214,6 @@ 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( "culled", BOOLEAN, false, false, true, Dali::DevelActor::Property::CULLED ) -DALI_PROPERTY( "updateSizeHint", VECTOR2, true, false, true, Dali::DevelActor::Property::UPDATE_SIZE_HINT ) DALI_PROPERTY_TABLE_END( DEFAULT_ACTOR_PROPERTY_START_INDEX, ActorDefaultProperties ) // Signals @@ -2497,7 +2496,16 @@ void Actor::SetDefaultProperty( Property::Index index, const Property::Value& pr case Dali::Actor::Property::COLOR: { - SetColor( property.Get< Vector4 >() ); + Property::Type type = property.GetType(); + if( type == Property::VECTOR3 ) + { + Vector3 color = property.Get< Vector3 >(); + SetColor( Vector4( color.r, color.g, color.b, 1.0f ) ); + } + else if( type == Property::VECTOR4 ) + { + SetColor( property.Get< Vector4 >() ); + } break; } @@ -2719,12 +2727,6 @@ void Actor::SetDefaultProperty( Property::Index index, const Property::Value& pr break; } - case Dali::DevelActor::Property::UPDATE_SIZE_HINT: - { - SetUpdateSizeHint( property.Get< Vector2 >() ); - break; - } - default: { // this can happen in the case of a non-animatable default property so just do nothing @@ -2928,6 +2930,19 @@ void Actor::OnNotifyDefaultPropertyAnimation( Animation& animation, Property::In { if( value.Get( mTargetSize ) ) { + if( mRelayoutData ) + { + if( GetResizePolicy( Dimension::WIDTH ) == ResizePolicy::FIXED ) + { + mRelayoutData->preferredSize.width = mTargetSize.width; + } + + if( GetResizePolicy( Dimension::HEIGHT ) == ResizePolicy::FIXED ) + { + mRelayoutData->preferredSize.height = mTargetSize.height; + } + } + // Notify deriving classes OnSizeAnimation( animation, mTargetSize ); } @@ -2938,6 +2953,11 @@ void Actor::OnNotifyDefaultPropertyAnimation( Animation& animation, Property::In { if( value.Get( mTargetSize.width ) ) { + if( mRelayoutData && GetResizePolicy( Dimension::WIDTH ) == ResizePolicy::FIXED ) + { + mRelayoutData->preferredSize.width = mTargetSize.width; + } + // Notify deriving classes OnSizeAnimation( animation, mTargetSize ); } @@ -2948,6 +2968,11 @@ void Actor::OnNotifyDefaultPropertyAnimation( Animation& animation, Property::In { if( value.Get( mTargetSize.height ) ) { + if( mRelayoutData && GetResizePolicy( Dimension::HEIGHT ) == ResizePolicy::FIXED ) + { + mRelayoutData->preferredSize.height = mTargetSize.height; + } + // Notify deriving classes OnSizeAnimation( animation, mTargetSize ); } @@ -3072,6 +3097,19 @@ void Actor::OnNotifyDefaultPropertyAnimation( Animation& animation, Property::In { if( AdjustValue< Vector3 >( mTargetSize, value ) ) { + if( mRelayoutData ) + { + if( GetResizePolicy( Dimension::WIDTH ) == ResizePolicy::FIXED ) + { + mRelayoutData->preferredSize.width = mTargetSize.width; + } + + if( GetResizePolicy( Dimension::HEIGHT ) == ResizePolicy::FIXED ) + { + mRelayoutData->preferredSize.height = mTargetSize.height; + } + } + // Notify deriving classes OnSizeAnimation( animation, mTargetSize ); } @@ -3082,6 +3120,11 @@ void Actor::OnNotifyDefaultPropertyAnimation( Animation& animation, Property::In { if( AdjustValue< float >( mTargetSize.width, value ) ) { + if( mRelayoutData && GetResizePolicy( Dimension::WIDTH ) == ResizePolicy::FIXED ) + { + mRelayoutData->preferredSize.width = mTargetSize.width; + } + // Notify deriving classes OnSizeAnimation( animation, mTargetSize ); } @@ -3092,6 +3135,11 @@ void Actor::OnNotifyDefaultPropertyAnimation( Animation& animation, Property::In { if( AdjustValue< float >( mTargetSize.height, value ) ) { + if( mRelayoutData && GetResizePolicy( Dimension::HEIGHT ) == ResizePolicy::FIXED ) + { + mRelayoutData->preferredSize.height = mTargetSize.height; + } + // Notify deriving classes OnSizeAnimation( animation, mTargetSize ); } @@ -3983,12 +4031,6 @@ bool Actor::GetCurrentPropertyValue( Property::Index index, Property::Value& val break; } - case Dali::DevelActor::Property::UPDATE_SIZE_HINT: - { - value = GetUpdateSizeHint(); - break; - } - default: { // Must be an event-side only property @@ -4742,20 +4784,6 @@ float Actor::GetMaximumSize( Dimension::Type dimension ) const return FLT_MAX; // Default } -void Actor::SetUpdateSizeHint( const Vector2& updateSizeHint ) -{ - // node is being used in a separate thread; queue a message to set the value & base value - SceneGraph::NodeTransformPropertyMessage::Send( GetEventThreadServices(), &GetNode(), &GetNode().mUpdateSizeHint, &SceneGraph::TransformManagerPropertyHandler::Bake, Vector3(updateSizeHint.width, updateSizeHint.height, 0.f ) ); -} - -Vector2 Actor::GetUpdateSizeHint() const -{ - // node is being used in a separate thread; copy the value from the previous update - Vector3 updateSizeHint = Vector3::ZERO; - GetNode().GetUpdateSizeHint( GetEventThreadServices().GetEventBufferIndex(), updateSizeHint ); - return Vector2( updateSizeHint.width, updateSizeHint.height ); -} - Object* Actor::GetParentObject() const { return mParent;