*/
// CLASS HEADER
-
#include "view-impl.h"
// EXTERNAL INCLUDES
+#include <dali/public-api/animation/constraints.h>
+#include <dali/public-api/common/stage.h>
+#include <dali/public-api/object/type-registry.h>
// INTERNAL INCLUDES
mBackgroundLayer = Layer::New();
mBackgroundLayer.SetPositionInheritanceMode( Dali::USE_PARENT_POSITION );
- mBackgroundLayer.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) );
+ mBackgroundLayer.SetSize( mViewSize );
// Add background layer to custom actor.
Self().Add( mBackgroundLayer );
}
backgroundImage.SetPositionInheritanceMode( Dali::USE_PARENT_POSITION );
- Constraint constraint = Constraint::New<Vector3>(
- Actor::SCALE,
- LocalSource( Actor::SIZE ),
- ParentSource( Actor::SIZE ),
- ScaleToFillXYKeepAspectRatioConstraint() );
- backgroundImage.ApplyConstraint( constraint );
+ backgroundImage.SetScale( FillXYKeepAspectRatio( mViewSize, backgroundImage.GetSize() ) );
mBackgroundLayer.Add( backgroundImage );
}
}
}
- mRotateAnimation.SetDestroyAction( Animation::Bake );
-
Toolkit::View handle( GetOwner() );
- mOrientationAnimationStartedSignalV2.Emit( handle, mRotateAnimation, orientation );
+ mOrientationAnimationStartedSignal.Emit( handle, mRotateAnimation, orientation );
mRotateAnimation.Play();
}
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 )
}
}
+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;