Control to call Init derived classes before applying style 52/40752/2
authorAgnelo Vaz <agnelo.vaz@samsung.com>
Mon, 8 Jun 2015 16:40:54 +0000 (17:40 +0100)
committerAgnelo Vaz <agnelo.vaz@samsung.com>
Mon, 8 Jun 2015 16:50:47 +0000 (17:50 +0100)
Change-Id: Ib485ee1b53906a279f8e53797a492ddaf2552c94
Signed-off-by: Agnelo Vaz <agnelo.vaz@samsung.com>
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()