}
}
+ 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.
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 **/
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);
}
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)