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=d89adf94e0bd2bc607a99cfd4ee48cf0a1bd2800;hb=6ae6cb59fdc507c422db80110606c4125c19466b;hpb=b2b0bec92c5632c2cad9223656cf67b152442d3c diff --git a/dali-toolkit/internal/text/decorator/text-decorator.cpp b/dali-toolkit/internal/text/decorator/text-decorator.cpp index d89adf9..543c232 100644 --- a/dali-toolkit/internal/text/decorator/text-decorator.cpp +++ b/dali-toolkit/internal/text/decorator/text-decorator.cpp @@ -946,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. @@ -2302,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); } @@ -2321,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)