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=21e13c82052709c7ea6addfa63f5cfd396c172b5;hp=b6c02d7b3a0f3da78f6ca01b005dc2367d453bc9;hb=91a31a5bdf35ebea5818c3809467b6fb74a547a2;hpb=fa3f750c6878eb126034d7958458dc3a1f67924f 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 b6c02d7..21e13c8 100644 --- a/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp @@ -47,6 +47,7 @@ #include #include +// DEVEL INCLUDES #include using namespace Dali::Toolkit::Text; @@ -133,6 +134,7 @@ DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextLabel, "textFit", DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextLabel, "minLineSize", FLOAT, MIN_LINE_SIZE ) DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextLabel, "renderingBackend", INTEGER, RENDERING_BACKEND ) DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextLabel, "fontSizeScale", FLOAT, FONT_SIZE_SCALE ) +DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextLabel, "ellipsisPosition", INTEGER, ELLIPSIS_POSITION ) DALI_ANIMATABLE_PROPERTY_REGISTRATION_WITH_DEFAULT(Toolkit, TextLabel, "textColor", Color::BLACK, TEXT_COLOR ) DALI_ANIMATABLE_PROPERTY_COMPONENT_REGISTRATION(Toolkit, TextLabel, "textColorRed", TEXT_COLOR_RED, TEXT_COLOR, 0) @@ -264,6 +266,17 @@ void TextLabel::SetProperty(BaseObject* object, Property::Index index, const Pro case Toolkit::TextLabel::Property::TEXT: { impl.mController->SetText(value.Get()); + + if(impl.mController->HasAnchors()) + { + // Forward input events to controller + impl.EnableGestureDetection(static_cast(GestureType::TAP)); + } + else + { + impl.DisableGestureDetection(static_cast(GestureType::TAP)); + } + break; } case Toolkit::TextLabel::Property::FONT_FAMILY: @@ -316,6 +329,16 @@ void TextLabel::SetProperty(BaseObject* object, Property::Index index, const Pro { const bool enableMarkup = value.Get(); impl.mController->SetMarkupProcessorEnabled(enableMarkup); + + if(impl.mController->HasAnchors()) + { + // Forward input events to controller + impl.EnableGestureDetection(static_cast(GestureType::TAP)); + } + else + { + impl.DisableGestureDetection(static_cast(GestureType::TAP)); + } break; } case Toolkit::TextLabel::Property::ENABLE_AUTO_SCROLL: @@ -481,6 +504,16 @@ void TextLabel::SetProperty(BaseObject* object, Property::Index index, const Pro } break; } + case Toolkit::DevelTextLabel::Property::ELLIPSIS_POSITION: + { + DevelText::EllipsisPosition::Type ellipsisPositionType(static_cast(-1)); // Set to invalid value to ensure a valid mode does get set + if(GetEllipsisPositionTypeEnumeration(value, ellipsisPositionType)) + { + DALI_LOG_INFO(gLogFilter, Debug::General, "TextLabel %p EllipsisPosition::Type %d\n", impl.mController.Get(), ellipsisPositionType); + impl.mController->SetEllipsisPosition(ellipsisPositionType); + } + break; + } } // Request relayout when text update is needed. It's necessary to call it @@ -717,6 +750,11 @@ Property::Value TextLabel::GetProperty(BaseObject* object, Property::Index index value = impl.mController->GetFontSizeScale(); break; } + case Toolkit::DevelTextLabel::Property::ELLIPSIS_POSITION: + { + value = impl.mController->GetEllipsisPosition(); + break; + } } } @@ -787,10 +825,6 @@ void TextLabel::OnInitialize() self.LayoutDirectionChangedSignal().Connect(this, &TextLabel::OnLayoutDirectionChanged); - // Forward input events to controller - EnableGestureDetection(static_cast(GestureType::TAP)); - GetTapGestureDetector().SetMaximumTapsRequired(1); - Layout::Engine& engine = mController->GetLayoutEngine(); engine.SetCursorWidth(0u); // Do not layout space for the cursor. @@ -841,9 +875,6 @@ void TextLabel::OnTap(const TapGesture& gesture) padding = Self().GetProperty(Toolkit::Control::Property::PADDING); const Vector2& localPoint = gesture.GetLocalPoint(); mController->AnchorEvent(localPoint.x - padding.start, localPoint.y - padding.top); - - // parents can also listen for tap gesture events - Dali::DevelActor::SetNeedGesturePropagation(Self(), true); } void TextLabel::AnchorClicked(const std::string& href)