The up-call is required as per the control writing guidelines.
A relayout request is required so that the control's fonts and size can be recalculated.
A similar fix has already been pushed to the product branch.
Change-Id: Ib23baeef60d6fb6fb3e68105defba9a30b458b5f
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Toolkit::TextLabel label = Toolkit::TextLabel::New(labelStr);
Stage::GetCurrent().Add( label );
- Toolkit::TextLabel label2 = Toolkit::TextLabel::New(labelStr);
- Stage::GetCurrent().Add( label2 );
+ Toolkit::TextField field = Toolkit::TextField::New();
+ Stage::GetCurrent().Add( field );
+
+ Toolkit::TextEditor editor = Toolkit::TextEditor::New();
+ Stage::GetCurrent().Add( editor );
StyleChangedSignalChecker styleChangedSignalHandler;
Dali::StyleMonitor styleMonitor = Dali::StyleMonitor::Get();
DALI_TEST_EQUALS( familyStr, "Times New Roman", TEST_LOCATION);
+ // Check that the field's font style has been altered
+ family = field.GetProperty(TextField::Property::FONT_FAMILY);
+ family.Get( familyStr );
+
+ DALI_TEST_EQUALS( familyStr, "Times New Roman", TEST_LOCATION);
+
+ // Check that the editor's font style has been altered
+ family = editor.GetProperty(TextEditor::Property::FONT_FAMILY);
+ family.Get( familyStr );
+
+ DALI_TEST_EQUALS( familyStr, "Times New Roman", TEST_LOCATION);
+
END_TEST;
}
const std::string& newFont = GetImpl( styleManager ).GetDefaultFontFamily();
// Property system did not set the font so should update it.
mController->UpdateAfterFontChange( newFont );
+ RelayoutRequest();
break;
}
case StyleChange::DEFAULT_FONT_SIZE_CHANGE:
{
GetImpl( styleManager ).ApplyThemeStyle( Toolkit::Control( GetOwner() ) );
+ RelayoutRequest();
break;
}
case StyleChange::THEME_CHANGE:
{
- GetImpl( styleManager ).ApplyThemeStyle( Toolkit::Control( GetOwner() ) );
+ // Nothing to do, let control base class handle this
break;
}
}
+
+ // Up call to Control
+ Control::OnStyleChange( styleManager, change );
}
Vector3 TextEditor::GetNaturalSize()
const std::string& newFont = GetImpl( styleManager ).GetDefaultFontFamily();
// Property system did not set the font so should update it.
mController->UpdateAfterFontChange( newFont );
+ RelayoutRequest();
break;
}
case StyleChange::DEFAULT_FONT_SIZE_CHANGE:
{
GetImpl( styleManager ).ApplyThemeStyle( Toolkit::Control( GetOwner() ) );
+ RelayoutRequest();
break;
}
case StyleChange::THEME_CHANGE:
{
- GetImpl( styleManager ).ApplyThemeStyle( Toolkit::Control( GetOwner() ) );
+ // Nothing to do, let control base class handle this
break;
}
}
+
+ // Up call to Control
+ Control::OnStyleChange( styleManager, change );
}
Vector3 TextField::GetNaturalSize()
const std::string& newFont = GetImpl( styleManager ).GetDefaultFontFamily();
DALI_LOG_INFO( gLogFilter, Debug::General, "TextLabel::OnStyleChange StyleChange::DEFAULT_FONT_CHANGE newFont(%s)\n", newFont.c_str() );
mController->UpdateAfterFontChange( newFont );
+ RelayoutRequest();
break;
}
case StyleChange::DEFAULT_FONT_SIZE_CHANGE:
{
GetImpl( styleManager ).ApplyThemeStyle( Toolkit::Control( GetOwner() ) );
+ RelayoutRequest();
break;
}
case StyleChange::THEME_CHANGE:
{
- GetImpl( styleManager ).ApplyThemeStyle( Toolkit::Control( GetOwner() ) );
+ // Nothing to do, let control base class handle this
break;
}
}
+
+ // Up call to Control
+ Control::OnStyleChange( styleManager, change );
}
Vector3 TextLabel::GetNaturalSize()
if( styleManager && change == StyleChange::THEME_CHANGE )
{
GetImpl( styleManager ).ApplyThemeStyle( Toolkit::Control( GetOwner() ) );
+ RelayoutRequest();
}
- RelayoutRequest();
}
void Control::OnPinch(const PinchGesture& pinch)