X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Fdecorator%2Ftext-decorator.cpp;h=543c232a3e2f25fe70053389c112753ccdc92d99;hp=d005d94f93834d5e17b57ba7b1b063a4ea94114d;hb=6ae6cb59fdc507c422db80110606c4125c19466b;hpb=16ef097a0b2d3945a5045db7bb2f3896ed5a5a95 diff --git a/dali-toolkit/internal/text/decorator/text-decorator.cpp b/dali-toolkit/internal/text/decorator/text-decorator.cpp index d005d94..543c232 100644 --- a/dali-toolkit/internal/text/decorator/text-decorator.cpp +++ b/dali-toolkit/internal/text/decorator/text-decorator.cpp @@ -746,12 +746,15 @@ struct Decorator::Impl : public ConnectionTracker { layer.SetProperty(Actor::Property::NAME, "ActiveLayerActor"); } + else if(type == DecorationType::CURSOR_LAYER) + { + layer.SetProperty(Actor::Property::NAME, "CursorLayerActor"); + } #endif bool needsClipping = false; if(type == DecorationType::CURSOR_LAYER) { needsClipping = true; - layer.SetProperty(Actor::Property::NAME, "CursorLayerActor"); } layer.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); @@ -943,6 +946,19 @@ struct Decorator::Impl : public ConnectionTracker } } + void CreateSelectionPopup() + { + if(!mCopyPastePopup.actor) + { + mCopyPastePopup.actor = TextSelectionPopup::New(&mTextSelectionPopupCallbackInterface); + #ifdef DECORATOR_DEBUG + mCopyPastePopup.actor.SetProperty(Dali::Actor::Property::NAME, "mCopyPastePopup"); + #endif + mCopyPastePopup.actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + mCopyPastePopup.actor.OnRelayoutSignal().Connect(this, &Decorator::Impl::SetPopupPosition); // Position popup after size negotiation + } + } + void CalculateHandleWorldCoordinates(HandleImpl& handle, Vector2& position) { // Gets the world position of the active layer. The active layer is where the handles are added. @@ -2106,6 +2122,27 @@ int Decorator::GetCursorWidth() const void Decorator::SetEditable(bool editable) { mImpl->mHidePrimaryCursorAndGrabHandle = !editable; + // If editable is false, all decorators should be disabled. + if(!editable) + { + if(IsHighlightActive()) + { + SetHighlightActive(false); + } + if(IsHandleActive(LEFT_SELECTION_HANDLE)) + { + SetHandleActive(LEFT_SELECTION_HANDLE, false); + } + if(IsHandleActive(RIGHT_SELECTION_HANDLE)) + { + SetHandleActive(RIGHT_SELECTION_HANDLE, false); + } + if(IsPopupActive()) + { + SetPopupActive(false); + } + } + mImpl->Relayout(mImpl->mControlSize); } /** Handles **/ @@ -2278,17 +2315,7 @@ bool Decorator::IsPopupActive() const void Decorator::SetEnabledPopupButtons(TextSelectionPopup::Buttons& enabledButtonsBitMask) { mImpl->mEnabledPopupButtons = enabledButtonsBitMask; - - if(!mImpl->mCopyPastePopup.actor) - { - mImpl->mCopyPastePopup.actor = TextSelectionPopup::New(&mImpl->mTextSelectionPopupCallbackInterface); -#ifdef DECORATOR_DEBUG - mImpl->mCopyPastePopup.actor.SetProperty(Dali::Actor::Property::NAME, "mCopyPastePopup"); -#endif - mImpl->mCopyPastePopup.actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); - mImpl->mCopyPastePopup.actor.OnRelayoutSignal().Connect(mImpl, &Decorator::Impl::SetPopupPosition); // Position popup after size negotiation - } - + mImpl->CreateSelectionPopup(); mImpl->mCopyPastePopup.actor.EnableButtons(mImpl->mEnabledPopupButtons); } @@ -2297,6 +2324,20 @@ TextSelectionPopup::Buttons& Decorator::GetEnabledPopupButtons() return mImpl->mEnabledPopupButtons; } +void Decorator::SetSelectionPopupStyle(const Property::Map& options) +{ + mImpl->CreateSelectionPopup(); + mImpl->mCopyPastePopup.actor.SetProperties(options); +} + +void Decorator::GetSelectionPopupStyle(Property::Map& options) +{ + if(mImpl->mCopyPastePopup.actor) + { + mImpl->mCopyPastePopup.actor.GetProperties(options); + } +} + /** Scroll **/ void Decorator::SetScrollThreshold(float threshold)