Size negotiation patch 1: Remove SetPreferred size 78/37678/2
authorKingsley Stephens <k.stephens@samsung.com>
Thu, 2 Apr 2015 10:37:59 +0000 (11:37 +0100)
committerKingsley Stephens <k.stephens@samsung.com>
Thu, 2 Apr 2015 10:47:40 +0000 (03:47 -0700)
Change-Id: I33d4a33a2b50e1d5a5debf1a2f5be5f24c97dd0a

demo/dali-table-view.cpp
examples/buttons/buttons-example.cpp
examples/cluster/cluster-example.cpp
examples/dissolve-effect/dissolve-effect-example.cpp
examples/item-view/item-view-example.cpp
examples/radial-menu/radial-menu-example.cpp
examples/shadow-bone-lighting/shadow-bone-lighting-example.cpp
examples/size-negotiation/size-negotiation-example.cpp
examples/text-view/text-view-example.cpp
shared/view.h

index f0992f4..668a1ab 100644 (file)
@@ -311,8 +311,7 @@ void DaliTableView::Initialize( Application& application )
   ImageActor backgroundColourActor = Dali::Toolkit::CreateSolidColorActor( BACKGROUND_COLOR );
   backgroundColourActor.SetAnchorPoint( AnchorPoint::CENTER );
   backgroundColourActor.SetParentOrigin( ParentOrigin::CENTER );
-  backgroundColourActor.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
-  backgroundColourActor.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
+  backgroundColourActor.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, ALL_DIMENSIONS );
   backgroundColourActor.SetSizeModeFactor( Vector3( 1.0f, 1.5f, 1.0f ) );
   backgroundColourActor.SetZ( BACKGROUND_Z );
   mScrollViewLayer.Add( backgroundColourActor );
@@ -514,8 +513,7 @@ Actor DaliTableView::CreateTile( const std::string& name, const std::string& tit
   content.SetAnchorPoint( AnchorPoint::CENTER );
   content.SetParentOrigin( ParentOrigin::CENTER );
   content.SetRelayoutEnabled( true );
-  content.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
-  content.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
+  content.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, ALL_DIMENSIONS );
   content.SetSizeModeFactor( sizeMultiplier );
 
   // create background image
@@ -549,8 +547,7 @@ Actor DaliTableView::CreateTile( const std::string& name, const std::string& tit
   text.SetTextAlignment( Toolkit::Alignment::Type( Alignment::HorizontalCenter | Alignment::VerticalCenter ) );
   text.SetZ( 1 );
   // make the text 90% of tile
-  text.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
-  text.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
+  text.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, ALL_DIMENSIONS );
   text.SetSizeModeFactor( Vector3( 0.9f, 0.9f, 0.0f ) );
   text.SetStyleToCurrentText( GetTableTextStyle() );
   text.SetSnapshotModeEnabled( false );
@@ -1029,8 +1026,7 @@ void DaliTableView::OnLogoTapped( Dali::Actor actor, const Dali::TapGesture& tap
       mVersionPopup = Dali::Toolkit::Popup::New();
       mVersionPopup.SetParentOrigin( ParentOrigin::CENTER );
       mVersionPopup.SetAnchorPoint( AnchorPoint::CENTER );
-      mVersionPopup.SetResizePolicy( FILL_TO_PARENT, WIDTH );
-      mVersionPopup.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
+      mVersionPopup.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, WIDTH );
       mVersionPopup.SetSizeModeFactor( Vector3( 0.75f, 1.0f, 1.0f ) );
       mVersionPopup.SetResizePolicy( FIT_TO_CHILDREN, HEIGHT );
       mVersionPopup.SetTitle( stream.str() );
index b6b82ff..d4a03a6 100644 (file)
@@ -128,7 +128,7 @@ class ButtonsController: public ConnectionTracker
     radioGroup2Background.SetParentOrigin( ParentOrigin::TOP_LEFT );
     radioGroup2Background.SetPosition( DP(MARGIN_SIZE), DP(yPos) );
     radioGroup2Background.SetRelayoutEnabled( true );
-    radioGroup2Background.SetPreferredSize( Vector2( DP(348), DP(GROUP2_HEIGHT) ) );
+    radioGroup2Background.SetSize( DP(348), DP(GROUP2_HEIGHT) );
     mContentLayer.Add( radioGroup2Background );
 
     Actor radioButtonsGroup2 = Actor::New();
@@ -136,7 +136,7 @@ class ButtonsController: public ConnectionTracker
     radioButtonsGroup2.SetAnchorPoint( AnchorPoint::TOP_LEFT );
     radioButtonsGroup2.SetPosition( DP(MARGIN_SIZE), DP(MARGIN_SIZE) );
     radioButtonsGroup2.SetRelayoutEnabled( true );
-    radioButtonsGroup2.SetPreferredSize( Vector2( DP(100), DP(160) ) );
+    radioButtonsGroup2.SetSize( DP(100), DP(160) );
 
     radioGroup2Background.Add( radioButtonsGroup2 );
 
@@ -145,7 +145,7 @@ class ButtonsController: public ConnectionTracker
     // Radio 1
     {
       ImageActor imageActor = ImageActor::New( ResourceImage::New( SMALL_IMAGE_1 ) );
-      imageActor.SetPreferredSize( Vector2( DP(RADIO_LABEL_THUMBNAIL_SIZE), DP(RADIO_LABEL_THUMBNAIL_SIZE) ) );
+      imageActor.SetSize( DP(RADIO_LABEL_THUMBNAIL_SIZE), DP(RADIO_LABEL_THUMBNAIL_SIZE) );
       mRadioButtonImage1 = Dali::Toolkit::RadioButton::New( imageActor );
       mRadioButtonImage1.SetParentOrigin( ParentOrigin::TOP_LEFT );
       mRadioButtonImage1.SetAnchorPoint( AnchorPoint::TOP_LEFT );
@@ -160,7 +160,7 @@ class ButtonsController: public ConnectionTracker
       radioY += RADIO_LABEL_THUMBNAIL_SIZE + RADIO_IMAGE_SPACING;
 
       ImageActor imageActor = ImageActor::New( ResourceImage::New( SMALL_IMAGE_2 ) );
-      imageActor.SetPreferredSize( Vector2( DP(RADIO_LABEL_THUMBNAIL_SIZE), DP(RADIO_LABEL_THUMBNAIL_SIZE) ) );
+      imageActor.SetSize( DP(RADIO_LABEL_THUMBNAIL_SIZE), DP(RADIO_LABEL_THUMBNAIL_SIZE) );
 
       mRadioButtonImage2 = Dali::Toolkit::RadioButton::New( imageActor );
       mRadioButtonImage2.SetParentOrigin( ParentOrigin::TOP_LEFT );
@@ -175,7 +175,7 @@ class ButtonsController: public ConnectionTracker
       radioY += RADIO_LABEL_THUMBNAIL_SIZE + RADIO_IMAGE_SPACING;
 
       ImageActor imageActor = ImageActor::New( ResourceImage::New( SMALL_IMAGE_3 ) );
-      imageActor.SetPreferredSize( Vector2( DP(RADIO_LABEL_THUMBNAIL_SIZE), DP(RADIO_LABEL_THUMBNAIL_SIZE) ) );
+      imageActor.SetSize( DP(RADIO_LABEL_THUMBNAIL_SIZE), DP(RADIO_LABEL_THUMBNAIL_SIZE) );
 
       mRadioButtonImage3 = Dali::Toolkit::RadioButton::New( imageActor );
       mRadioButtonImage3.SetParentOrigin( ParentOrigin::TOP_LEFT );
@@ -191,7 +191,7 @@ class ButtonsController: public ConnectionTracker
     mUpdateButton.SetAnchorPoint( AnchorPoint::TOP_CENTER );
     mUpdateButton.SetPosition( 0, DP(MARGIN_SIZE) );
     mUpdateButton.SetLabel( "Select" );
-    mUpdateButton.SetPreferredSize( Vector2( DP(100), DP(BUTTON_HEIGHT) ) );
+    mUpdateButton.SetSize( DP(100), DP(BUTTON_HEIGHT) );
 
     mUpdateButton.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) );
     mUpdateButton.SetDisabledImage( Dali::ResourceImage::New( PUSHBUTTON_DISABLED_IMAGE ) );
@@ -210,7 +210,7 @@ class ButtonsController: public ConnectionTracker
     mImage.SetParentOrigin( ParentOrigin::TOP_RIGHT );
     mImage.SetAnchorPoint( AnchorPoint::TOP_LEFT );
     mImage.SetPosition( DP(MARGIN_SIZE), 0 );
-    mImage.SetPreferredSize( Vector2( DP(218), DP(218) ) );
+    mImage.SetSize( DP(218), DP(218) );
     radioButtonsGroup2.Add( mImage );
 
     // The enable/disable radio group
@@ -221,7 +221,7 @@ class ButtonsController: public ConnectionTracker
     radioGroup1Background.SetParentOrigin( ParentOrigin::TOP_LEFT );
     radioGroup1Background.SetPosition( DP(MARGIN_SIZE), DP(yPos) );
     radioGroup1Background.SetRelayoutEnabled( true );
-    radioGroup1Background.SetPreferredSize( Vector2( DP(348), DP(GROUP1_HEIGHT) ) );
+    radioGroup1Background.SetSize( DP(348), DP(GROUP1_HEIGHT) );
     mContentLayer.Add( radioGroup1Background );
 
     // Radio group
@@ -235,14 +235,14 @@ class ButtonsController: public ConnectionTracker
     // First radio button
     {
       Toolkit::TableView tableView = Toolkit::TableView::New( 1, 2 );
-      tableView.SetPreferredSize( Vector2( DP(260), 0.0f ) );
+      tableView.SetSize( DP(260), 0.0f );
       tableView.SetResizePolicy( USE_NATURAL_SIZE, HEIGHT );
 
       Toolkit::TextView textView = Toolkit::TextView::New( "Select enabled" );
       tableView.AddChild( textView, Toolkit::TableView::CellPosition( 0, 0 ) );
 
       ImageActor imageActor = ImageActor::New( ResourceImage::New( ENABLED_IMAGE ) );
-      imageActor.SetPreferredSize( Vector2( DP(RADIO_LABEL_THUMBNAIL_SIZE), DP(RADIO_LABEL_THUMBNAIL_SIZE) ) );
+      imageActor.SetSize( DP(RADIO_LABEL_THUMBNAIL_SIZE), DP(RADIO_LABEL_THUMBNAIL_SIZE) );
       imageActor.SetResizePolicy( FIXED, ALL_DIMENSIONS );
       imageActor.SetPadding( Padding( DP(20.0f), 0.0f, 0.0f, 0.0f ) );
       tableView.AddChild( imageActor, Toolkit::TableView::CellPosition( 0, 1 ) );
@@ -280,7 +280,7 @@ class ButtonsController: public ConnectionTracker
     checkBoxBackground.SetParentOrigin( ParentOrigin::TOP_LEFT );
     checkBoxBackground.SetPosition( DP(MARGIN_SIZE), DP(yPos) );
     checkBoxBackground.SetRelayoutEnabled( true );
-    checkBoxBackground.SetPreferredSize( Vector2( DP(430), DP(GROUP3_HEIGHT) ) );
+    checkBoxBackground.SetSize( DP(430), DP(GROUP3_HEIGHT) );
     mContentLayer.Add( checkBoxBackground );
 
     Dali::Image unselected = Dali::ResourceImage::New( CHECKBOX_UNSELECTED_IMAGE );
@@ -341,7 +341,7 @@ class ButtonsController: public ConnectionTracker
     toggleBackground.SetParentOrigin( ParentOrigin::TOP_LEFT );
     toggleBackground.SetPosition( DP(MARGIN_SIZE), DP(yPos) );
     toggleBackground.SetRelayoutEnabled( true );
-    toggleBackground.SetPreferredSize( Vector2( DP(150 + MARGIN_SIZE * 2), DP(GROUP4_HEIGHT) ) );
+    toggleBackground.SetSize( DP(150 + MARGIN_SIZE * 2), DP(GROUP4_HEIGHT) );
     mContentLayer.Add( toggleBackground );
 
     Toolkit::PushButton toggleButton = Toolkit::PushButton::New();
@@ -350,7 +350,7 @@ class ButtonsController: public ConnectionTracker
     toggleButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
     toggleButton.SetPosition( DP(MARGIN_SIZE), DP(MARGIN_SIZE) );
     toggleButton.SetLabel( "Unselected" );
-    toggleButton.SetPreferredSize( Vector2( DP(150), DP(BUTTON_HEIGHT) ) );
+    toggleButton.SetSize( DP(150), DP(BUTTON_HEIGHT) );
 
     toggleButton.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) );
     toggleButton.SetDisabledImage( Dali::ResourceImage::New( PUSHBUTTON_DISABLED_IMAGE ) );
index 73e8490..6053b7a 100644 (file)
@@ -580,8 +580,7 @@ public:
     shadowActor.SetPosition(Vector3(0.0f, 0.0f, -1.0f));
 
     // Apply size-relative mode to auto-size the image shadow
-    shadowActor.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
-    shadowActor.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
+    shadowActor.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, ALL_DIMENSIONS );
     shadowActor.SetSizeModeFactor( ShadowProperty::SIZE_SCALE );
     actor.Add( shadowActor );
 
@@ -600,8 +599,7 @@ public:
     borderActor.SetStyle( ImageActor::STYLE_NINE_PATCH );
     borderActor.SetNinePatchBorder( CLUSTER_IMAGE_BORDER_ABSOLUTE );
     borderActor.SetPosition( Vector3( 0.0f, 0.0f, 1.0f ) );
-    borderActor.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
-    borderActor.SetSizeMode( SIZE_FIXED_OFFSET_FROM_PARENT );
+    borderActor.SetResizePolicy( SIZE_FIXED_OFFSET_FROM_PARENT, ALL_DIMENSIONS );
     borderActor.SetSizeModeFactor( Vector3( CLUSTER_IMAGE_BORDER_INDENT - 1.0f, CLUSTER_IMAGE_BORDER_INDENT - 1.0f, 0.0f ) * 2.0f );
     actor.Add( borderActor );
 
index c1f7786..8d0f90f 100644 (file)
@@ -252,6 +252,7 @@ void DissolveEffectApp::OnInit( Application& application )
 
   // show the first image
   mCurrentImage = ImageActor::New( LoadStageFillingImage( IMAGES[mIndex] ) );
+  mCurrentImage.SetRelayoutEnabled( false );
   mCurrentImage.SetPositionInheritanceMode(USE_PARENT_POSITION_PLUS_LOCAL_POSITION);
   mCurrentImage.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
   mCurrentImage.SetSizeScalePolicy( FIT_WITH_ASPECT_RATIO );
@@ -282,6 +283,7 @@ void DissolveEffectApp::OnPanGesture( Actor actor, const PanGesture& gesture )
 
     Image image = LoadStageFillingImage( IMAGES[ mIndex ] );
     mNextImage = ImageActor::New( image );
+    mNextImage.SetRelayoutEnabled( false );
     mNextImage.SetPositionInheritanceMode(USE_PARENT_POSITION_PLUS_LOCAL_POSITION);
     mNextImage.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
     mNextImage.SetSizeScalePolicy( FIT_WITH_ASPECT_RATIO );
index 841f630..54c49af 100644 (file)
@@ -279,10 +279,9 @@ public:
     mDeleteButton.SetAnchorPoint(AnchorPoint::BOTTOM_RIGHT);
     mDeleteButton.SetPosition( BUTTON_BORDER, BUTTON_BORDER );
     mDeleteButton.SetDrawMode( DrawMode::OVERLAY );
-    mDeleteButton.SetBackgroundImage( ResourceImage::New( TOOLBAR_IMAGE ) );
     mDeleteButton.SetButtonImage( ResourceImage::New( DELETE_IMAGE ) );
-    mDeleteButton.SetResizePolicy( FIXED, ALL_DIMENSIONS );
-    mDeleteButton.SetPreferredSize( Vector2( stageSize.width * 0.15f, stageSize.width * 0.15f ) );
+    mDeleteButton.SetBackgroundImage( ResourceImage::New( TOOLBAR_IMAGE ) );
+    mDeleteButton.SetSize( Vector2( stageSize.width * 0.15f, stageSize.width * 0.15f ) );
     mDeleteButton.ClickedSignal().Connect( this, &ItemViewExample::OnDeleteButtonClicked);
     mDeleteButton.SetLeaveRequired( true );
     mDeleteButton.SetVisible( false );
@@ -294,10 +293,9 @@ public:
     mInsertButton.SetAnchorPoint(AnchorPoint::BOTTOM_RIGHT);
     mInsertButton.SetPosition( BUTTON_BORDER, BUTTON_BORDER );
     mInsertButton.SetDrawMode( DrawMode::OVERLAY );
-    mInsertButton.SetBackgroundImage( ResourceImage::New( TOOLBAR_IMAGE ) );
     mInsertButton.SetButtonImage( ResourceImage::New( INSERT_IMAGE ) );
-    mInsertButton.SetResizePolicy( FIXED, ALL_DIMENSIONS );
-    mInsertButton.SetPreferredSize( Vector2( stageSize.width * 0.15f, stageSize.width * 0.15f ) );
+    mInsertButton.SetBackgroundImage( ResourceImage::New( TOOLBAR_IMAGE ) );
+    mInsertButton.SetSize( stageSize.width * 0.15f, stageSize.width * 0.15f );
     mInsertButton.ClickedSignal().Connect( this, &ItemViewExample::OnInsertButtonClicked);
     mInsertButton.SetLeaveRequired( true );
     mInsertButton.SetVisible( false );
@@ -309,10 +307,9 @@ public:
     mReplaceButton.SetAnchorPoint(AnchorPoint::BOTTOM_RIGHT);
     mReplaceButton.SetPosition( BUTTON_BORDER, BUTTON_BORDER );
     mReplaceButton.SetDrawMode( DrawMode::OVERLAY );
-    mReplaceButton.SetBackgroundImage( ResourceImage::New( TOOLBAR_IMAGE ) );
     mReplaceButton.SetButtonImage( ResourceImage::New( REPLACE_IMAGE ) );
-    mReplaceButton.SetResizePolicy( FIXED, ALL_DIMENSIONS );
-    mReplaceButton.SetPreferredSize( Vector2( stageSize.width * 0.15f, stageSize.width * 0.15f ) );
+    mReplaceButton.SetBackgroundImage( ResourceImage::New( TOOLBAR_IMAGE ) );
+    mReplaceButton.SetSize( stageSize.width * 0.15f, stageSize.width * 0.15f );
     mReplaceButton.ClickedSignal().Connect( this, &ItemViewExample::OnReplaceButtonClicked);
     mReplaceButton.SetLeaveRequired( true );
     mReplaceButton.SetVisible( false );
@@ -901,8 +898,7 @@ public: // From ItemFactory
     borderActor.SetStyle( ImageActor::STYLE_NINE_PATCH );
     borderActor.SetNinePatchBorder( Vector4( ITEM_IMAGE_BORDER_LEFT, ITEM_IMAGE_BORDER_TOP, ITEM_IMAGE_BORDER_RIGHT, ITEM_IMAGE_BORDER_BOTTOM ) );
     borderActor.SetColorMode( USE_OWN_MULTIPLY_PARENT_COLOR ); // darken with parent image-actor
-    borderActor.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
-    borderActor.SetSizeMode( SIZE_FIXED_OFFSET_FROM_PARENT );
+    borderActor.SetResizePolicy( SIZE_FIXED_OFFSET_FROM_PARENT, ALL_DIMENSIONS );
     borderActor.SetSizeModeFactor( ITEM_BORDER_MARGIN_SIZE );
     actor.Add(borderActor);
     actor.SetKeyboardFocusable( true );
@@ -995,8 +991,7 @@ private:
     mMenu = Toolkit::Popup::New();
     mMenu.SetParentOrigin( ParentOrigin::BOTTOM_LEFT );
     mMenu.SetAnchorPoint( AnchorPoint::BOTTOM_LEFT );
-    mMenu.SetResizePolicy( FIXED, ALL_DIMENSIONS );
-    mMenu.SetPreferredSize( Vector2( popupWidth, MENU_OPTION_HEIGHT * 2 ) );
+    mMenu.SetSize( popupWidth, MENU_OPTION_HEIGHT * 2 );
     mMenu.OutsideTouchedSignal().Connect( this, &ItemViewExample::HideMenu );
 
     TableView tableView = TableView::New( 0, 0 );
@@ -1026,8 +1021,7 @@ private:
     text.SetTextAlignment( Dali::Toolkit::Alignment::HorizontalLeft );
     text.SetStyleToCurrentText( defaultTextStyle );
     text.SetResizePolicy( FILL_TO_PARENT, WIDTH );
-    text.SetResizePolicy( FIXED, HEIGHT );
-    text.SetPreferredSize( Vector2( 0.0f, LABEL_TEXT_SIZE_Y ) );
+    text.SetSize( 0.0f, LABEL_TEXT_SIZE_Y );
     text.SetZ( -0.9f );
     slider.Add( text );
 
@@ -1051,8 +1045,7 @@ private:
     text.SetTextAlignment( Dali::Toolkit::Alignment::HorizontalLeft );
     text.SetStyleToCurrentText( defaultTextStyle );
     text.SetResizePolicy( FILL_TO_PARENT, WIDTH );
-    text.SetResizePolicy( FIXED, HEIGHT );
-    text.SetPreferredSize( Vector2( 0.0f, LABEL_TEXT_SIZE_Y ) );
+    text.SetSize( 0.0f, LABEL_TEXT_SIZE_Y );
     textContainer.Add( text );
 
     mMenu.MarkDirtyForRelayout();
index 1e54ced..40bf308 100644 (file)
@@ -165,6 +165,7 @@ void RadialMenuExample::OnInit(Application& app)
 
   Image dial = ResourceImage::New( TEST_DIAL_FILENAME );
   mDialActor = ImageActor::New( dial );
+  mDialActor.SetResizePolicy( USE_NATURAL_SIZE, ALL_DIMENSIONS );
   mDialActor.SetPositionInheritanceMode(USE_PARENT_POSITION);
   mDialActor.SetScale(scale);
   Layer dialLayer = Layer::New();
@@ -242,6 +243,7 @@ RadialSweepView RadialMenuExample::CreateSweepView( std::string imageName,
   mImageActor = ImageActor::New(image);
   mImageActor.SetParentOrigin(ParentOrigin::CENTER);
   mImageActor.SetAnchorPoint(AnchorPoint::CENTER);
+  mImageActor.SetResizePolicy( USE_NATURAL_SIZE, ALL_DIMENSIONS );
 
   // Create the stencil
   Vector2 imageSize = ResourceImage::GetImageSize(imageName);
index 09ee56c..8aa17a2 100644 (file)
@@ -272,6 +272,9 @@ public:
     mImageActor2 = ImageActor::New( ResourceImage::New(SCENE_IMAGE_2) );
     mImageActor3 = ImageActor::New( ResourceImage::New(SCENE_IMAGE_3) );
 
+    mImageActor1.SetResizePolicy( USE_NATURAL_SIZE, ALL_DIMENSIONS );
+    mImageActor2.SetResizePolicy( USE_NATURAL_SIZE, ALL_DIMENSIONS );
+    mImageActor3.SetResizePolicy( USE_NATURAL_SIZE, ALL_DIMENSIONS );
 
     mImageActor2.SetParentOrigin(ParentOrigin::CENTER);
 
index 130f83b..473f16a 100644 (file)
@@ -251,7 +251,7 @@ public:
     mMenu.SetAnchorPoint( AnchorPoint::TOP_LEFT );
     mMenu.HideTail();
     mMenu.OutsideTouchedSignal().Connect( this, &SizeNegotiationController::HideMenu );
-    mMenu.SetPreferredSize( Vector2( popupWidth, 0.0f ) );
+    mMenu.SetSize( popupWidth, 0.0f );
     mMenu.SetResizePolicy( FIT_TO_CHILDREN, HEIGHT );
 
     Toolkit::TableView tableView = Toolkit::TableView::New( 0, 0 );
@@ -327,7 +327,7 @@ public:
     popup.SetName( "POPUP" );
     popup.SetParentOrigin( ParentOrigin::CENTER );
     popup.SetAnchorPoint( AnchorPoint::CENTER );
-    popup.SetPreferredSize( Vector2( POPUP_WIDTH_DP, 0.0f ) );
+    popup.SetSize( POPUP_WIDTH_DP, 0.0f );
     popup.HideTail();
 
     popup.OutsideTouchedSignal().Connect( this, &SizeNegotiationController::OnPopupOutsideTouched );
@@ -445,7 +445,7 @@ public:
       text.SetWidthExceedPolicy( Toolkit::TextView::Split );
       text.SetLineJustification( Toolkit::TextView::Center );
       text.SetResizePolicy( FILL_TO_PARENT, WIDTH );
-      text.SetDimensionDependency( HEIGHT, WIDTH );
+      text.SetResizePolicy( DIMENSION_DEPENDENCY, HEIGHT );
       text.SetPadding( Padding( 20.0f, 20.0f, 20.0f, 20.0f ) );
 
       mPopup.Add( text );
@@ -461,7 +461,7 @@ public:
 
       ImageActor image = ImageActor::New( ResourceImage::New( IMAGE2 ) );
       image.SetResizePolicy( FILL_TO_PARENT, WIDTH );
-      image.SetDimensionDependency( HEIGHT, WIDTH );
+      image.SetResizePolicy( DIMENSION_DEPENDENCY, HEIGHT );
       image.SetPadding( Padding( 20.0f, 20.0f, 20.0f, 20.0f ) );
 
       mPopup.Add( image );
@@ -475,8 +475,7 @@ public:
     {
       mPopup = CreatePopup();
 
-      mPopup.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
-      mPopup.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
+      mPopup.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, ALL_DIMENSIONS );
       mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
 
       ImageActor image = ImageActor::New( ResourceImage::New( IMAGE2 ) );
@@ -493,8 +492,7 @@ public:
     {
       mPopup = CreatePopup();
 
-      mPopup.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
-      mPopup.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
+      mPopup.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, ALL_DIMENSIONS );
       mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
 
       ImageActor image = ImageActor::New( ResourceImage::New( IMAGE2 ) );
@@ -512,8 +510,7 @@ public:
     {
       mPopup = CreatePopup();
 
-      mPopup.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
-      mPopup.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
+      mPopup.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, ALL_DIMENSIONS );
       mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
 
       ImageActor image = ImageActor::New( ResourceImage::New( IMAGE2 ) );
@@ -539,7 +536,7 @@ public:
       text.SetWidthExceedPolicy( Toolkit::TextView::Split );
       text.SetLineJustification( Toolkit::TextView::Center );
       text.SetResizePolicy( FILL_TO_PARENT, WIDTH );
-      text.SetDimensionDependency( HEIGHT, WIDTH );
+      text.SetResizePolicy( DIMENSION_DEPENDENCY, HEIGHT );
       text.SetPadding( Padding( 20.0f, 20.0f, 20.0f, 20.0f ) );
 
       mPopup.Add( text );
@@ -561,7 +558,7 @@ public:
       text.SetWidthExceedPolicy( Toolkit::TextView::Split );
       text.SetLineJustification( Toolkit::TextView::Left );
       text.SetResizePolicy( FILL_TO_PARENT, WIDTH );
-      text.SetDimensionDependency( HEIGHT, WIDTH );
+      text.SetResizePolicy( DIMENSION_DEPENDENCY, HEIGHT );
       text.SetPadding( Padding( 10.0f, 10.0f, 20.0f, 0.0f ) );
 
       mPopup.Add( text );
@@ -613,7 +610,7 @@ public:
         text.SetWidthExceedPolicy( Toolkit::TextView::Split );
         text.SetLineJustification( Toolkit::TextView::Left );
         text.SetResizePolicy( FILL_TO_PARENT, WIDTH );
-        text.SetDimensionDependency( HEIGHT, WIDTH );
+        text.SetResizePolicy( DIMENSION_DEPENDENCY, HEIGHT );
 
         content.AddChild( text, Toolkit::TableView::CellPosition( 0, 0 ) );
       }
@@ -623,7 +620,7 @@ public:
         ImageActor image = ImageActor::New( ResourceImage::New( IMAGE1 ) );
         image.SetName( "COMPLEX_IMAGE" );
         image.SetResizePolicy( FILL_TO_PARENT, WIDTH );
-        image.SetDimensionDependency( HEIGHT, WIDTH );
+        image.SetResizePolicy( DIMENSION_DEPENDENCY, HEIGHT );
         image.SetPadding( Padding( 20.0f, 0.0f, 0.0f, 0.0f ) );
         content.AddChild( image, Toolkit::TableView::CellPosition( 0, 1 ) );
       }
@@ -642,8 +639,7 @@ public:
         Toolkit::CheckBoxButton checkBox = Toolkit::CheckBoxButton::New();
         checkBox.SetBackgroundImage( unchecked );
         checkBox.SetSelectedImage( checked );
-        checkBox.SetPreferredSize( Vector2( 48, 48 ) );
-        checkBox.SetResizePolicy( FIXED, ALL_DIMENSIONS );
+        checkBox.SetSize( 48, 48 );
 
         root.AddChild( checkBox, Toolkit::TableView::CellPosition( 0, 0 ) );
 
@@ -689,8 +685,7 @@ public:
     else if( button.GetName() == TABLEVIEW_BUTTON_EMPTY_ID )
     {
       mPopup = CreatePopup();
-      mPopup.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
-      mPopup.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
+      mPopup.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, ALL_DIMENSIONS );
       mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
 
 
@@ -707,8 +702,7 @@ public:
     else if( button.GetName() == TABLEVIEW_BUTTON_1CELL_ID )
     {
       mPopup = CreatePopup();
-      mPopup.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
-      mPopup.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
+      mPopup.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, ALL_DIMENSIONS );
       mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
 
 
@@ -730,8 +724,7 @@ public:
     else if( button.GetName() == TABLEVIEW_BUTTON_3CELL_ID )
     {
       mPopup = CreatePopup();
-      mPopup.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
-      mPopup.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
+      mPopup.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, ALL_DIMENSIONS );
       mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
 
 
@@ -764,8 +757,7 @@ public:
     else if( button.GetName() == TABLEVIEW_BUTTON_3X3CELL_ID )
     {
       mPopup = CreatePopup();
-      mPopup.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
-      mPopup.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
+      mPopup.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, ALL_DIMENSIONS );
       mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
 
 
@@ -833,8 +825,7 @@ public:
     else if( button.GetName() == TABLEVIEW_BUTTON_FIXED1_ID )
     {
       mPopup = CreatePopup();
-      mPopup.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
-      mPopup.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
+      mPopup.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, ALL_DIMENSIONS );
       mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
 
 
@@ -880,8 +871,7 @@ public:
     else if( button.GetName() == TABLEVIEW_BUTTON_FIXED2_ID )
     {
       mPopup = CreatePopup();
-      mPopup.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
-      mPopup.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
+      mPopup.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, ALL_DIMENSIONS );
       mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
 
 
@@ -928,8 +918,7 @@ public:
     else if( button.GetName() == TABLEVIEW_BUTTON_FIT1_ID )
     {
       mPopup = CreatePopup();
-      mPopup.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
-      mPopup.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
+      mPopup.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, ALL_DIMENSIONS );
       mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
 
 
@@ -941,8 +930,7 @@ public:
       {
         Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) );
         backing.SetResizePolicy( FILL_TO_PARENT, WIDTH );
-        backing.SetResizePolicy( FIXED, HEIGHT );
-        backing.SetPreferredSize( Vector2( 0.0f, 100.0f ) );
+        backing.SetSize( 0.0f, 100.0f );
 
         TextActor text = TextActor::New( "Fit" );
         text.SetAnchorPoint( AnchorPoint::CENTER );
@@ -965,8 +953,7 @@ public:
       {
         Actor backing = Toolkit::CreateSolidColorActor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) );
         backing.SetResizePolicy( FILL_TO_PARENT, WIDTH );
-        backing.SetResizePolicy( FIXED, HEIGHT );
-        backing.SetPreferredSize( Vector2( 0.0f, 100.0f ) );
+        backing.SetSize( 0.0f, 100.0f );
 
         TextActor text = TextActor::New( "Fit" );
         text.SetAnchorPoint( AnchorPoint::CENTER );
@@ -986,11 +973,9 @@ public:
     else if( button.GetName() == TABLEVIEW_BUTTON_FIT2_ID )
     {
       mPopup = CreatePopup();
-      mPopup.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
-      mPopup.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
+      mPopup.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, ALL_DIMENSIONS );
       mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
 
-
       Toolkit::TableView table = Toolkit::TableView::New( 3, 1 );
       table.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
       table.SetFitHeight( 1 );
@@ -1009,8 +994,7 @@ public:
       {
         Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 1.0f, 0.0f, 1.0f ) );
         backing.SetResizePolicy( FILL_TO_PARENT, WIDTH );
-        backing.SetResizePolicy( FIXED, HEIGHT );
-        backing.SetPreferredSize( Vector2( 0.0f, 200.0f ) );
+        backing.SetSize( 0.0f, 200.0f );
 
         TextActor text = TextActor::New( "Fit" );
         text.SetAnchorPoint( AnchorPoint::CENTER );
@@ -1041,8 +1025,7 @@ public:
     else if( button.GetName() == TABLEVIEW_BUTTON_NATURAL1_ID )
     {
       mPopup = CreatePopup();
-      mPopup.SetResizePolicy( FILL_TO_PARENT, WIDTH );
-      mPopup.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
+      mPopup.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, WIDTH );
       mPopup.SetSizeModeFactor( Vector3( 0.75f, 1.0f, 1.0f ) );
       mPopup.SetResizePolicy( FIT_TO_CHILDREN, HEIGHT );
 
@@ -1056,8 +1039,7 @@ public:
       {
         Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) );
         backing.SetResizePolicy( FILL_TO_PARENT, WIDTH );
-        backing.SetResizePolicy( FIXED, HEIGHT );
-        backing.SetPreferredSize( Vector2( 0.0f, 100.0f ) );
+        backing.SetSize( 0.0f, 100.0f );
 
         TextActor text = TextActor::New( "Fit" );
         text.SetAnchorPoint( AnchorPoint::CENTER );
@@ -1069,8 +1051,7 @@ public:
       {
         Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 1.0f, 0.0f, 1.0f ) );
         backing.SetResizePolicy( FILL_TO_PARENT, WIDTH );
-        backing.SetResizePolicy( FIXED, HEIGHT );
-        backing.SetPreferredSize( Vector2( 0.0f, 200.0f ) );
+        backing.SetSize( 0.0f, 200.0f );
 
         TextActor text = TextActor::New( "Fit" );
         text.SetAnchorPoint( AnchorPoint::CENTER );
@@ -1082,8 +1063,7 @@ public:
       {
         Actor backing = Toolkit::CreateSolidColorActor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) );
         backing.SetResizePolicy( FILL_TO_PARENT, WIDTH );
-        backing.SetResizePolicy( FIXED, HEIGHT );
-        backing.SetPreferredSize( Vector2( 0.0f, 300.0f ) );
+        backing.SetSize( 0.0f, 300.0f );
 
         TextActor text = TextActor::New( "Fit" );
         text.SetAnchorPoint( AnchorPoint::CENTER );
@@ -1103,8 +1083,7 @@ public:
     else if( button.GetName() == TABLEVIEW_BUTTON_NATURAL2_ID )
     {
       mPopup = CreatePopup();
-      mPopup.SetResizePolicy( FILL_TO_PARENT, WIDTH );
-      mPopup.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
+      mPopup.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, WIDTH );
       mPopup.SetSizeModeFactor( Vector3( 0.75f, 1.0f, 1.0f ) );
       mPopup.SetResizePolicy( FIT_TO_CHILDREN, HEIGHT );
 
@@ -1118,7 +1097,7 @@ public:
         Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) );
         backing.SetResizePolicy( FILL_TO_PARENT, WIDTH );
         backing.SetResizePolicy( FIXED, HEIGHT );
-        backing.SetPreferredSize( Vector2( 0.0f, 100.0f ) );
+        backing.SetSize( 0.0f, 100.0f );
 
         TextActor text = TextActor::New( "Fit" );
         text.SetAnchorPoint( AnchorPoint::CENTER );
@@ -1130,8 +1109,7 @@ public:
       {
         Actor backing = Toolkit::CreateSolidColorActor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) );
         backing.SetResizePolicy( FILL_TO_PARENT, WIDTH );
-        backing.SetResizePolicy( FIXED, HEIGHT );
-        backing.SetPreferredSize( Vector2( 0.0f, 200.0f ) );
+        backing.SetSize( 0.0f, 200.0f );
 
         TextActor text = TextActor::New( "Fit" );
         text.SetAnchorPoint( AnchorPoint::CENTER );
@@ -1151,8 +1129,7 @@ public:
     else if( button.GetName() == TABLEVIEW_BUTTON_NATURAL3_ID )
     {
       mPopup = CreatePopup();
-      mPopup.SetResizePolicy( FILL_TO_PARENT, WIDTH );
-      mPopup.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
+      mPopup.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, WIDTH );
       mPopup.SetSizeModeFactor( Vector3( 0.75f, 1.0f, 1.0f ) );
       mPopup.SetResizePolicy( FIT_TO_CHILDREN, HEIGHT );
 
@@ -1176,8 +1153,7 @@ public:
       {
         Actor backing = Toolkit::CreateSolidColorActor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) );
         backing.SetResizePolicy( FILL_TO_PARENT, WIDTH );
-        backing.SetResizePolicy( FIXED, HEIGHT );
-        backing.SetPreferredSize( Vector2( 0.0f, 200.0f ) );
+        backing.SetSize( 0.0f, 200.0f );
 
         TextActor text = TextActor::New( "Fit" );
         text.SetAnchorPoint( AnchorPoint::CENTER );
index aefda6d..c90b227 100644 (file)
@@ -132,7 +132,7 @@ public:
     textContainer.SetParentOrigin( ParentOrigin::TOP_LEFT );
     textContainer.SetAnchorPoint( AnchorPoint::TOP_LEFT );
     textContainer.SetPosition( 0, TOOLBAR_HEIGHT );
-    textContainer.SetPreferredSize( Vector2( stage.GetSize().width, stage.GetSize().height - TOOLBAR_HEIGHT ) );
+    textContainer.SetSize( stage.GetSize().width, stage.GetSize().height - TOOLBAR_HEIGHT );
 
     mContentLayer.Add( textContainer );
 
index 0d29283..f456182 100644 (file)
@@ -87,9 +87,8 @@ Dali::Layer CreateToolbar( Dali::Toolkit::ToolBar& toolBar,
   toolBarLayer.SetName( "TOOLBAR_LAYER" );
   toolBarLayer.SetAnchorPoint( Dali::AnchorPoint::TOP_CENTER );
   toolBarLayer.SetParentOrigin( Dali::ParentOrigin::TOP_CENTER );
-  toolBarLayer.SetPreferredSize( Dali::Vector2( 0.0f, style.mToolBarHeight ) );
+  toolBarLayer.SetSize( 0.0f, style.mToolBarHeight );
   toolBarLayer.SetResizePolicy( Dali::FILL_TO_PARENT, Dali::WIDTH );
-  toolBarLayer.SetResizePolicy( Dali::FIXED, Dali::HEIGHT );
 
   // Raise tool bar layer to the top.
   toolBarLayer.RaiseToTop();