Merge "Control to call Init derived classes before applying style" into devel/master
authorPaul Wisbey <p.wisbey@samsung.com>
Mon, 8 Jun 2015 18:10:39 +0000 (11:10 -0700)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Mon, 8 Jun 2015 18:10:39 +0000 (11:10 -0700)
dali-toolkit/public-api/controls/control-impl.cpp

index 1cb02bf..0d7a2f0 100644 (file)
@@ -797,6 +797,9 @@ Control::Control( ControlBehaviour behaviourFlags )
 
 void Control::Initialize()
 {
+  // Call deriving classes so initialised before styling is applied to them.
+  OnInitialize();
+
   if( mImpl->mFlags & REQUIRES_STYLE_CHANGE_SIGNALS )
   {
     Toolkit::StyleManager styleManager = Toolkit::StyleManager::Get();
@@ -804,7 +807,7 @@ void Control::Initialize()
     // Register for style changes
     styleManager.StyleChangeSignal().Connect( this, &Control::OnStyleChange );
 
-    // SetTheme
+    // Apply the current style
     GetImpl( styleManager ).ApplyThemeStyle( Toolkit::Control( GetOwner() ) );
   }
 
@@ -812,9 +815,6 @@ void Control::Initialize()
   {
     SetKeyboardNavigationSupport( true );
   }
-
-  // Calling deriving classes
-  OnInitialize();
 }
 
 void Control::OnInitialize()