Actor actor = Actor::New();
// Defaults
- DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::WIDTH_RESIZE_POLICY ).Get< std::string >(), "FIXED", TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::HEIGHT_RESIZE_POLICY ).Get< std::string >(), "FIXED", TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::WIDTH_RESIZE_POLICY ).Get< std::string >(), "USE_NATURAL_SIZE", TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::HEIGHT_RESIZE_POLICY ).Get< std::string >(), "USE_NATURAL_SIZE", TEST_LOCATION );
// Set resize policy for all dimensions
actor.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
{
Impl::TestCustomActor* impl = new Impl::TestCustomActor( true );
TestCustomActor custom( *impl ); // takes ownership
+ custom.SetName( "SizeNegotiationActor" );
impl->Initialize();
namespace
{
-DALI_ENUM_TO_STRING_TABLE_BEGIN( Type )DALI_ENUM_TO_STRING( FIXED )
+DALI_ENUM_TO_STRING_TABLE_BEGIN( Type )
+DALI_ENUM_TO_STRING( FIXED )
DALI_ENUM_TO_STRING( USE_NATURAL_SIZE )
DALI_ENUM_TO_STRING( FILL_TO_PARENT )
DALI_ENUM_TO_STRING( SIZE_RELATIVE_TO_PARENT )
namespace
{
// Enumeration to / from string conversion tables
-DALI_ENUM_TO_STRING_TABLE_BEGIN( Type )DALI_ENUM_TO_STRING( USE_SIZE_SET )
+DALI_ENUM_TO_STRING_TABLE_BEGIN( Type )
+DALI_ENUM_TO_STRING( USE_SIZE_SET )
DALI_ENUM_TO_STRING( FIT_WITH_ASPECT_RATIO )
DALI_ENUM_TO_STRING( FILL_WITH_ASPECT_RATIO )
DALI_ENUM_TO_STRING_TABLE_END( Type )
// Set size negotiation defaults
for( unsigned int i = 0; i < Dimension::DIMENSION_COUNT; ++i )
{
- resizePolicies[ i ] = ResizePolicy::FIXED;
+ resizePolicies[ i ] = ResizePolicy::DEFAULT;
negotiatedDimensions[ i ] = 0.0f;
dimensionNegotiated[ i ] = false;
dimensionDirty[ i ] = false;
}
}
- return ResizePolicy::FIXED; // Default
+ return ResizePolicy::DEFAULT;
}
void Actor::SetSizeScalePolicy( SizeScalePolicy::Type policy )
// The stage owns the default layer
mRootLayer = Layer::NewRoot( *mLayerList, mUpdateManager, false/*not system-level*/ );
mRootLayer->SetName("RootLayer");
+ // The root layer needs to have a fixed resize policy (as opposed to the default USE_NATURAL_SIZE).
+ // This stops actors parented to the stage having their relayout requests propagating
+ // up to the root layer, and down through other children unnecessarily.
+ mRootLayer->SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
// Create the default camera actor first; this is needed by the RenderTaskList
CreateDefaultCameraActor();
* Only to be used after the image has finished loading.
* (Ticket's LoadingSucceeded callback was called)
* The returned value will reflect the true image dimensions once the asynchronous loading has finished.
- * Connect to SignalLoadingFinished or use GetLoadingState to make sure this value is actual.
* @pre image should be loaded
*/
virtual unsigned int GetWidth() const;
* Only to be used after the image has finished loading.
* (Ticket's LoadingSucceeded callback was called)
* The returned value will reflect the true image dimensions once the asynchronous loading has finished.
- * Connect to SignalLoadingFinished or use GetLoadingState to make sure this value is actual.
* @pre image should be loaded
*/
virtual unsigned int GetHeight() const;
DIMENSION_DEPENDENCY, ///< One dimension is dependent on the other
USE_ASSIGNED_SIZE ///< The size will be assigned to the actor
};
+const Type DEFAULT = USE_NATURAL_SIZE; ///< Default resize policy
}
/**