X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=optional%2Fdali-toolkit%2Finternal%2Fcontrols%2Fview%2Fview-impl.cpp;h=6c374c08aab6383a67180622d329a9d0c88e153b;hb=refs%2Fchanges%2F49%2F34949%2F3;hp=fa2a9d6ff076c3622a3063f881cecb3b2977fd7e;hpb=d5e3ed5f5b1c8fdba3ae97ead8729620f54b3836;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/optional/dali-toolkit/internal/controls/view/view-impl.cpp b/optional/dali-toolkit/internal/controls/view/view-impl.cpp index fa2a9d6..6c374c0 100644 --- a/optional/dali-toolkit/internal/controls/view/view-impl.cpp +++ b/optional/dali-toolkit/internal/controls/view/view-impl.cpp @@ -16,10 +16,12 @@ */ // CLASS HEADER - #include "view-impl.h" // EXTERNAL INCLUDES +#include +#include +#include // INTERNAL INCLUDES @@ -134,7 +136,7 @@ void View::SetBackground( ImageActor backgroundImage ) mBackgroundLayer = Layer::New(); mBackgroundLayer.SetPositionInheritanceMode( Dali::USE_PARENT_POSITION ); - mBackgroundLayer.ApplyConstraint( Constraint::New( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) ); + mBackgroundLayer.SetSize( mViewSize ); // Add background layer to custom actor. Self().Add( mBackgroundLayer ); @@ -154,12 +156,7 @@ void View::SetBackground( ImageActor backgroundImage ) } backgroundImage.SetPositionInheritanceMode( Dali::USE_PARENT_POSITION ); - Constraint constraint = Constraint::New( - Actor::SCALE, - LocalSource( Actor::SIZE ), - ParentSource( Actor::SIZE ), - ScaleToFillXYKeepAspectRatioConstraint() ); - backgroundImage.ApplyConstraint( constraint ); + backgroundImage.SetScale( FillXYKeepAspectRatio( mViewSize, backgroundImage.GetSize() ) ); mBackgroundLayer.Add( backgroundImage ); } @@ -231,10 +228,8 @@ void View::OrientationChanged( Dali::Orientation orientation ) } } - mRotateAnimation.SetDestroyAction( Animation::Bake ); - Toolkit::View handle( GetOwner() ); - mOrientationAnimationStartedSignalV2.Emit( handle, mRotateAnimation, orientation ); + mOrientationAnimationStartedSignal.Emit( handle, mRotateAnimation, orientation ); mRotateAnimation.Play(); } @@ -244,9 +239,9 @@ void View::SetAutoRotate( bool enabled ) mAutoRotateEnabled = enabled; } -Toolkit::View::OrientationAnimationStartedSignalV2& View::OrientationAnimationStartedSignal() +Toolkit::View::OrientationAnimationStartedSignalType& View::OrientationAnimationStartedSignal() { - return mOrientationAnimationStartedSignalV2; + return mOrientationAnimationStartedSignal; } bool View::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor ) @@ -299,6 +294,20 @@ void View::OnInitialize() } } +void View::OnControlSizeSet( const Vector3& targetSize ) +{ + mViewSize = targetSize; + if( mBackgroundLayer ) + { + mBackgroundLayer.SetSize( mViewSize ); + if( mBackgroundLayer.GetChildCount() > 0 ) + { + Actor background = mBackgroundLayer.GetChildAt(0); + background.SetScale( FillXYKeepAspectRatio( mViewSize, background.GetSize() ) ); + } + } +} + View::Orientation View::DegreeToViewOrientation( Degree degree ) { View::Orientation orientation = PORTRAIT;