This is already provided in TextField.
And this should also be provided in TextEditor.
Change-Id: If4bdaeb86b11400b44ee50cd7484ff10b5405dc7
Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
const char* const PROPERTY_NAME_MAX_LENGTH = "maxLength";
const char* const PROPERTY_NAME_FONT_SIZE_SCALE = "fontSizeScale";
const char* const PROPERTY_NAME_GRAB_HANDLE_COLOR = "grabHandleColor";
-
+const char* const PROPERTY_NAME_ENABLE_GRAB_HANDLE_POPUP = "enableGrabHandlePopup";
const Vector4 PLACEHOLDER_TEXT_COLOR( 0.8f, 0.8f, 0.8f, 0.8f );
const Dali::Vector4 LIGHT_BLUE( 0.75f, 0.96f, 1.f, 1.f ); // The text highlight color.
DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_MATCH_SYSTEM_LANGUAGE_DIRECTION ) == DevelTextEditor::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION );
DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_MAX_LENGTH ) == DevelTextEditor::Property::MAX_LENGTH );
DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_GRAB_HANDLE_COLOR ) == DevelTextEditor::Property::GRAB_HANDLE_COLOR );
-
+ DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_ENABLE_GRAB_HANDLE_POPUP ) == DevelTextEditor::Property::ENABLE_GRAB_HANDLE_POPUP );
END_TEST;
}
editor.SetProperty( DevelTextEditor::Property::GRAB_HANDLE_COLOR, Color::GREEN );
DALI_TEST_EQUALS( editor.GetProperty<Vector4>( DevelTextEditor::Property::GRAB_HANDLE_COLOR ), Color::GREEN, TEST_LOCATION );
+ // Test the ENABLE_GRAB_HANDLE_POPUP property
+ editor.SetProperty( DevelTextEditor::Property::ENABLE_GRAB_HANDLE_POPUP, false );
+ DALI_TEST_EQUALS( editor.GetProperty<bool>( DevelTextEditor::Property::ENABLE_GRAB_HANDLE_POPUP ), false, TEST_LOCATION);
+
application.SendNotification();
application.Render();
* @details Name "grabHandleColor", type Property::VECTOR4.
*/
GRAB_HANDLE_COLOR,
+
+ /**
+ * @brief Enables the grab handle popup for text selection.
+ * @details Name "enableGrabHandlePopup", type Property::BOOLEAN.
+ * @note The default value is true, which means the grab handle popup is enabled by default.
+ */
+ ENABLE_GRAB_HANDLE_POPUP,
};
} // namespace Property
DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextEditor, "fontSizeScale", FLOAT, FONT_SIZE_SCALE )
DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextEditor, "primaryCursorPosition", INTEGER, PRIMARY_CURSOR_POSITION )
DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextEditor, "grabHandleColor", VECTOR4, GRAB_HANDLE_COLOR )
+DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextEditor, "enableGrabHandlePopup", BOOLEAN, ENABLE_GRAB_HANDLE_POPUP )
DALI_SIGNAL_REGISTRATION(Toolkit, TextEditor, "textChanged", SIGNAL_TEXT_CHANGED )
DALI_SIGNAL_REGISTRATION(Toolkit, TextEditor, "inputStyleChanged", SIGNAL_INPUT_STYLE_CHANGED)
impl.RequestTextRelayout();
break;
}
+ case Toolkit::DevelTextEditor::Property::ENABLE_GRAB_HANDLE_POPUP:
+ {
+ const bool grabHandlePopupEnabled = value.Get<bool>();
+ DALI_LOG_INFO(gLogFilter, Debug::General, "TextEditor %p ENABLE_GRAB_HANDLE_POPUP %d\n", impl.mController.Get(), grabHandlePopupEnabled);
+
+ impl.mController->SetGrabHandlePopupEnabled(grabHandlePopupEnabled);
+ break;
+ }
} // switch
} // texteditor
}
value = impl.mDecorator->GetHandleColor();
break;
}
+ case Toolkit::DevelTextEditor::Property::ENABLE_GRAB_HANDLE_POPUP:
+ {
+ value = impl.mController->IsGrabHandlePopupEnabled();
+ break;
+ }
} //switch
}