void TextSelectionHandle::move(const IntPoint& point, const IntRect& selectionRect)
{
IntPoint movePoint = point;
+ const int reverseMargin = 32;
int x, y, deviceWidth, deviceHeight;
+ int handleHeight;
+
+ edje_object_part_geometry_get(m_icon, "handle", 0, 0, 0, &handleHeight);
evas_object_geometry_get(m_widget, &x, &y, &deviceWidth, &deviceHeight);
- IntRect handleRect = getHandleRect();
-
- if ((movePoint.y() + handleRect.height()) > (y + deviceHeight)) {
- movePoint.setY(movePoint.y() - selectionRect.height());
- edje_object_signal_emit(m_icon, "elm,state,top", "elm");
- m_isTop = true;
- } else {
- edje_object_signal_emit(m_icon, "elm,state,bottom", "elm");
- m_isTop = false;
+
+ if ((m_isLeft && (movePoint.x() <= reverseMargin)) || (!m_isLeft && (movePoint.x() >= deviceWidth - reverseMargin))) {
+ if ((movePoint.y() + handleHeight) > (y + deviceHeight)) {
+ movePoint.setY(movePoint.y() - selectionRect.height());
+ edje_object_signal_emit(m_icon, "elm,state,top,reversed", "elm");
+ m_isTop = true;
+ } else {
+ edje_object_signal_emit(m_icon, "elm,state,bottom,reversed", "elm");
+ m_isTop = false;
+ }
+ }
+ else {
+ if ((movePoint.y() + handleHeight) > (y + deviceHeight)) {
+ movePoint.setY(movePoint.y() - selectionRect.height());
+ edje_object_signal_emit(m_icon, "elm,state,top", "elm");
+ m_isTop = true;
+ } else {
+ edje_object_signal_emit(m_icon, "elm,state,bottom", "elm");
+ m_isTop = false;
+ }
}
evas_object_move(m_icon, movePoint.x(), movePoint.y());
m_position = movePoint;
+
}
void TextSelectionHandle::show()
#if ENABLE(TIZEN_WEBKIT2_FOR_MOVING_TEXT_SELECTION_HANDLE_FROM_OSP)
const IntRect TextSelectionHandle::getHandleRect()
{
+ if (!evas_object_visible_get(m_icon))
+ return IntRect();
+
int x, y;
evas_object_geometry_get(m_icon, &x, &y, 0, 0);
edje_object_signal_emit(m_icon, "mouse,up,1", "handle");
#endif
+ if (m_textSelection->isEnabled())
+ setIsMouseDowned(false);
+
m_textSelection->handleMouseUp(this, m_mousePosition);
}