//Create the index buffer
Property::Map indexFormat;
- indexFormat["indices"] = Property::UNSIGNED_INTEGER;
+ indexFormat["indices"] = Property::INTEGER;
PropertyBuffer indexBuffer = PropertyBuffer::New( indexFormat, 6u );
indexBuffer.SetData(gQuadIndex);
{
mImpl->mStyleName = styleName;
- // Apply new style
+ // Apply new style, if stylemanager is available
Toolkit::StyleManager styleManager = Toolkit::StyleManager::Get();
- GetImpl( styleManager ).ApplyThemeStyle( Toolkit::Control( GetOwner() ) );
+ if( styleManager )
+ {
+ GetImpl( styleManager ).ApplyThemeStyle( Toolkit::Control( GetOwner() ) );
+ }
}
}
Actor actor = CreateBackground(Self(), color );
background.actor = actor;
mImpl->mAddRemoveBackgroundChild = true;
- // use insert to guarantee its the first child (so that OVERLAY mode works)
+ // use insert to guarantee its the first child (so that OVERLAY_2D mode works)
Self().Insert( 0, actor );
mImpl->mAddRemoveBackgroundChild = false;
}
// Set the background actor before adding so that we do not inform derived classes
background.actor = actor;
mImpl->mAddRemoveBackgroundChild = true;
- // use insert to guarantee its the first child (so that OVERLAY mode works)
+ // use insert to guarantee its the first child (so that OVERLAY_2D mode works)
Self().Insert( 0, actor );
mImpl->mAddRemoveBackgroundChild = false;
}
if( mImpl->mFlags & REQUIRES_STYLE_CHANGE_SIGNALS )
{
Toolkit::StyleManager styleManager = Toolkit::StyleManager::Get();
+ // if stylemanager is available
+ if( styleManager )
+ {
+ // Register for style changes
+ styleManager.StyleChangeSignal().Connect( this, &Control::OnStyleChange );
- // Register for style changes
- styleManager.StyleChangeSignal().Connect( this, &Control::OnStyleChange );
-
- // Apply the current style
- GetImpl( styleManager ).ApplyThemeStyle( Toolkit::Control( GetOwner() ) );
+ // Apply the current style
+ GetImpl( styleManager ).ApplyThemeStyleAtInit( Toolkit::Control( GetOwner() ) );
+ }
}
if( mImpl->mFlags & REQUIRES_KEYBOARD_NAVIGATION_SUPPORT )
void Control::OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change )
{
// By default the control is only interested in theme (not font) changes
- if( change == StyleChange::THEME_CHANGE )
+ if( styleManager && change == StyleChange::THEME_CHANGE )
{
GetImpl( styleManager ).ApplyThemeStyle( Toolkit::Control( GetOwner() ) );
}