X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Ftext-controls%2Ftext-label-impl.cpp;h=419d1c472e34f1e805e5bb69e3856062b7c5ba25;hp=6149e296de582d684a19c9cc5b260e46bd7f0461;hb=0a2f5e1551be90466c7b64173bd750c4009c744e;hpb=9db1f87a421a896c62580a733449486512315c9a diff --git a/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp b/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp index 6149e29..419d1c4 100644 --- a/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp @@ -88,6 +88,7 @@ DALI_PROPERTY_REGISTRATION( TextLabel, "shadow-offset", VECTOR2, SHADOW_O 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 @@ -171,7 +172,7 @@ void TextLabel::SetProperty( BaseObject* object, Property::Index index, const Pr { 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(); @@ -289,6 +290,20 @@ void TextLabel::SetProperty( BaseObject* object, Property::Index index, const Pr } 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; + } } } } @@ -387,6 +402,14 @@ Property::Value TextLabel::GetProperty( BaseObject* object, Property::Index inde } break; } + case Toolkit::TextLabel::Property::UNDERLINE_HEIGHT: + { + if ( impl.mController ) + { + value = impl.mController->GetUnderlineHeight(); + } + break; + } } } @@ -401,7 +424,7 @@ void TextLabel::OnInitialize() // 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 )