DALI_PROPERTY_REGISTRATION( TextLabel, "multi-line", BOOLEAN, MULTI_LINE )
DALI_PROPERTY_REGISTRATION( TextLabel, "horizontal-alignment", STRING, HORIZONTAL_ALIGNMENT )
DALI_PROPERTY_REGISTRATION( TextLabel, "vertical-alignment", STRING, VERTICAL_ALIGNMENT )
-DALI_PROPERTY_REGISTRATION( TextLabel, "shadow-offset", VECTOR2, SHADOW_OFFSET )
-DALI_PROPERTY_REGISTRATION( TextLabel, "shadow-color", VECTOR4, SHADOW_COLOR )
-
+DALI_PROPERTY_REGISTRATION( TextLabel, "text-color", VECTOR4, TEXT_COLOR )
+DALI_PROPERTY_REGISTRATION( TextLabel, "shadow-offset", VECTOR2, SHADOW_OFFSET )
+DALI_PROPERTY_REGISTRATION( TextLabel, "shadow-color", VECTOR4, SHADOW_COLOR )
+DALI_PROPERTY_REGISTRATION( TextLabel, "underline-enabled", BOOLEAN, UNDERLINE_ENABLED )
+DALI_PROPERTY_REGISTRATION( TextLabel, "underline-color", VECTOR4, UNDERLINE_COLOR )
+DALI_PROPERTY_REGISTRATION( TextLabel, "underline-height", FLOAT, UNDERLINE_HEIGHT )
DALI_TYPE_REGISTRATION_END()
} // namespace
{
float pointSize = value.Get< float >();
- if( impl.mController->GetDefaultPointSize() != pointSize /*TODO - epsilon*/ )
+ if( fabsf(impl.mController->GetDefaultPointSize() - pointSize) > Math::MACHINE_EPSILON_1 )
{
impl.mController->SetDefaultPointSize( pointSize );
impl.RequestTextRelayout();
}
break;
}
- case Toolkit::TextLabel::Property::SHADOW_OFFSET:
+
+ case Toolkit::TextLabel::Property::TEXT_COLOR:
+ {
+ if ( impl.mController )
+ {
+ Vector4 textColor = value.Get< Vector4 >();
+ if ( impl.mController->GetTextColor() != textColor )
+ {
+ impl.mController->SetTextColor( textColor );
+ impl.RequestTextRelayout();
+ }
+ }
+ break;
+ }
+
+ case Toolkit::TextLabel::Property::SHADOW_OFFSET:
{
if( impl.mController )
{
}
break;
}
+ case Toolkit::TextLabel::Property::UNDERLINE_COLOR:
+ {
+ if( impl.mController )
+ {
+ Vector4 color = value.Get< Vector4 >();
+ if ( impl.mController->GetUnderlineColor() != color )
+ {
+ impl.mController->SetUnderlineColor( color );
+ impl.RequestTextRelayout();
+ }
+ }
+ break;
+ }
+ case Toolkit::TextLabel::Property::UNDERLINE_ENABLED:
+ {
+ if( impl.mController )
+ {
+ bool enabled = value.Get< bool >();
+ if ( impl.mController->IsUnderlineEnabled() != enabled )
+ {
+ impl.mController->SetUnderlineEnabled( enabled );
+ impl.RequestTextRelayout();
+ }
+ }
+ break;
+ }
+
+ case Toolkit::TextLabel::Property::UNDERLINE_HEIGHT:
+ {
+ if( impl.mController )
+ {
+ float height = value.Get< float >();
+ if ( impl.mController->GetUnderlineHeight() != height )
+ {
+ impl.mController->SetUnderlineHeight( height );
+ impl.RequestTextRelayout();
+ }
+ }
+ break;
+ }
}
}
}
}
break;
}
- case Toolkit::TextLabel::Property::SHADOW_OFFSET:
+ case Toolkit::TextLabel::Property::TEXT_COLOR:
+ {
+ if ( impl.mController )
+ {
+ value = impl.mController->GetTextColor();
+ }
+ break;
+ }
+ case Toolkit::TextLabel::Property::SHADOW_OFFSET:
{
if ( impl.mController )
{
}
break;
}
+ case Toolkit::TextLabel::Property::UNDERLINE_COLOR:
+ {
+ if ( impl.mController )
+ {
+ value = impl.mController->GetUnderlineColor();
+ }
+ break;
+ }
+ case Toolkit::TextLabel::Property::UNDERLINE_ENABLED:
+ {
+ if ( impl.mController )
+ {
+ value = impl.mController->IsUnderlineEnabled();
+ }
+ break;
+ }
+ case Toolkit::TextLabel::Property::UNDERLINE_HEIGHT:
+ {
+ if ( impl.mController )
+ {
+ value = impl.mController->GetUnderlineHeight();
+ }
+ break;
+ }
}
}
// Use height-for-width negotiation by default
self.SetResizePolicy( FILL_TO_PARENT, WIDTH );
- self.SetDimensionDependency( HEIGHT, WIDTH );
+ self.SetResizePolicy( DIMENSION_DEPENDENCY, HEIGHT );
}
void TextLabel::OnStyleChange( Toolkit::StyleManager styleManager, StyleChange change )