const Vector2 optionMaxSize(50.0f, 100.0f);
const Vector2 optionMinSize(10.0f, 10.0f);
const Vector2 optionDividerSize(5.0f, 5.0f);
+ const Vector4 optionDividerPadding(20.0f, 20.0f, 10.0f, 10.0f);
popup.SetProperty(TextSelectionPopup::Property::POPUP_MAX_SIZE, popupMaxSize);
popup.SetProperty(TextSelectionPopup::Property::OPTION_MAX_SIZE, optionMaxSize);
popup.SetProperty(TextSelectionPopup::Property::OPTION_MIN_SIZE, optionMinSize);
popup.SetProperty(TextSelectionPopup::Property::OPTION_DIVIDER_SIZE, optionDividerSize);
+ popup.SetProperty(TextSelectionPopup::Property::OPTION_DIVIDER_PADDING, optionDividerPadding);
DALI_TEST_EQUALS( popup.GetProperty(TextSelectionPopup::Property::POPUP_MAX_SIZE).Get<Vector2>(), popupMaxSize, TEST_LOCATION);
DALI_TEST_EQUALS( popup.GetProperty(TextSelectionPopup::Property::OPTION_MAX_SIZE).Get<Vector2>(), optionMaxSize, TEST_LOCATION);
DALI_TEST_EQUALS( popup.GetProperty(TextSelectionPopup::Property::OPTION_MIN_SIZE).Get<Vector2>(), optionMinSize, TEST_LOCATION);
DALI_TEST_EQUALS( popup.GetProperty(TextSelectionPopup::Property::OPTION_DIVIDER_SIZE).Get<Vector2>(), optionDividerSize, TEST_LOCATION);
+ DALI_TEST_EQUALS( popup.GetProperty(TextSelectionPopup::Property::OPTION_DIVIDER_PADDING).Get<Vector4>(), optionDividerPadding, TEST_LOCATION);
END_TEST;
}
DALI_PROPERTY_REGISTRATION(Toolkit, TextSelectionPopup, "optionMaxSize", VECTOR2, OPTION_MAX_SIZE)
DALI_PROPERTY_REGISTRATION(Toolkit, TextSelectionPopup, "optionMinSize", VECTOR2, OPTION_MIN_SIZE)
DALI_PROPERTY_REGISTRATION(Toolkit, TextSelectionPopup, "optionDividerSize", VECTOR2, OPTION_DIVIDER_SIZE)
+DALI_PROPERTY_REGISTRATION(Toolkit, TextSelectionPopup, "optionDividerPadding", VECTOR4, OPTION_DIVIDER_PADDING)
DALI_PROPERTY_REGISTRATION(Toolkit, TextSelectionPopup, "popupClipboardButtonImage", STRING, POPUP_CLIPBOARD_BUTTON_ICON_IMAGE)
DALI_PROPERTY_REGISTRATION(Toolkit, TextSelectionPopup, "popupCutButtonImage", STRING, POPUP_CUT_BUTTON_ICON_IMAGE)
DALI_PROPERTY_REGISTRATION(Toolkit, TextSelectionPopup, "popupCopyButtonImage", STRING, POPUP_COPY_BUTTON_ICON_IMAGE)
impl.SetDimensionToCustomise(OPTION_DIVIDER_SIZE, value.Get<Vector2>());
break;
}
+ case Toolkit::TextSelectionPopup::Property::OPTION_DIVIDER_PADDING:
+ {
+ Vector4 padding(value.Get<Vector4>());
+ impl.SetOptionDividerPadding(Padding(padding.x, padding.y, padding.z, padding.w));
+ break;
+ }
case Toolkit::TextSelectionPopup::Property::POPUP_CLIPBOARD_BUTTON_ICON_IMAGE:
{
impl.SetButtonImage(Toolkit::TextSelectionPopup::CLIPBOARD, value.Get<std::string>());
value = impl.GetDimensionToCustomise(OPTION_DIVIDER_SIZE);
break;
}
+ case Toolkit::TextSelectionPopup::Property::OPTION_DIVIDER_PADDING:
+ {
+ Padding padding = impl.GetOptionDividerPadding();
+ value = Vector4(padding.x, padding.y, padding.top, padding.bottom);
+ break;
+ }
case Toolkit::TextSelectionPopup::Property::POPUP_CLIPBOARD_BUTTON_ICON_IMAGE:
{
value = impl.GetButtonImage(Toolkit::TextSelectionPopup::CLIPBOARD);
return mPressedImage;
}
+void TextSelectionPopup::SetOptionDividerPadding(const Padding& padding)
+{
+ DALI_LOG_INFO(gLogFilter, Debug::Verbose, "TextSelectionPopup::SetOptionDividerPadding padding(%f,%f,%f,%f)\n", padding.left, padding.right, padding.bottom, padding.top);
+ mOptionDividerPadding = Padding(padding.left, padding.right, padding.bottom, padding.top);
+}
+
+Padding TextSelectionPopup::GetOptionDividerPadding() const
+{
+ return mOptionDividerPadding;
+}
+
void TextSelectionPopup::CreateOrderedListOfPopupOptions()
{
mOrderListOfButtons.clear();
// 6. Add the divider
if(showDivider)
{
- const Size size(mOptionDividerSize.width, 0.0f); // Height FILL_TO_PARENT
+ const Size size(mOptionDividerSize.width, 0.0f); // Height FILL_TO_PARENT
+ const Padding padding(mOptionDividerPadding);
Toolkit::Control divider = Toolkit::Control::New();
#ifdef DECORATOR_DEBUG
#endif
divider.SetProperty(Actor::Property::SIZE, size);
divider.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::HEIGHT);
+ divider.SetProperty(Actor::Property::PADDING, padding);
divider.SetBackgroundColor(mDividerColor);
mToolbar.AddDivider(divider);
}
mOptionMaxSize(),
mOptionMinSize(),
mOptionDividerSize(),
+ mOptionDividerPadding(),
mEnabledButtons(Toolkit::TextSelectionPopup::NONE),
mCallbackInterface(callbackInterface),
mPressedColor(DEFAULT_OPTION_PRESSED_COLOR),
*/
std::string GetPressedImage() const;
+ /**
+ * Set option divider padding
+ * @param[in] padding BEGIN END BOTTOM TOP
+ */
+ void SetOptionDividerPadding(const Padding& padding);
+
+ /**
+ * Get option divider padding
+ * @return Padding
+ */
+ Padding GetOptionDividerPadding() const;
+
void CreateOrderedListOfPopupOptions();
void AddOption(const ButtonRequirement& button, bool showDivider, bool showIcons, bool showCaption);
std::string mSelectIconImage;
std::string mSelectAllIconImage;
- Size mPopupMaxSize; // Maximum size of the Popup
- Size mOptionMaxSize; // Maximum size of an Option button
- Size mOptionMinSize; // Minimum size of an Option button
- Size mOptionDividerSize; // Size of divider line
+ Size mPopupMaxSize; // Maximum size of the Popup
+ Size mOptionMaxSize; // Maximum size of an Option button
+ Size mOptionMinSize; // Minimum size of an Option button
+ Size mOptionDividerSize; // Size of divider line
+ Padding mOptionDividerPadding; // Padding of divider line
std::vector<ButtonRequirement> mOrderListOfButtons; // List of buttons in the order to be displayed and a flag to indicate if needed.