#include <appsvc/appsvc.h>
#include <FApp_AppControlManager.h>
#include <FApp_AppMessageImpl.h>
+#include <FBaseUtilMath.h>
#include <FGrp_BitmapImpl.h>
#include "FUi_Clipboard.h"
#include "FUi_ClipboardItem.h"
using namespace Tizen::App;
using namespace Tizen::Base;
using namespace Tizen::Base::Runtime;
+using namespace Tizen::Base::Utility;
using namespace Tizen::Graphics;
using namespace Tizen::Graphics::_Text;
using namespace Tizen::Ui::Animations;
FloatPoint checkPoint(0.0f, 0.0f);
_Edit* pEdit = __pCopyPasteManager->GetEdit();
_EditPresenter* pEditPresenter = pEdit->GetPresenter();
- TextObject* pTextObject = pEditPresenter->GetTextObject();
if (__singleHandler)
{
rect.x = cursorRect.x;
rect.y = cursorRect.y + cursorRect.height;
-
- if (pTextObject->GetAlignment() & TEXT_OBJECT_ALIGNMENT_RIGHT)
- {
- checkPoint = FloatPoint(cursorRect.x, cursorRect.y + cursorRect.height);
- }
- else
- {
- checkPoint = FloatPoint(cursorRect.x + cursorRect.width/2.0f, cursorRect.y + cursorRect.height);
- }
+ checkPoint = FloatPoint(cursorRect.x, cursorRect.y + cursorRect.height);
if (__leftHandler)
{
_EditCopyPasteHandler::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo)
{
int cursorPos = -1;
- int previousCursorPos = -1;
FloatRectangle cursorRect(0.0f, 0.0f, 0.0f, 0.0f);
FloatRectangle absCursorRect(0.0f, 0.0f, 0.0f, 0.0f);
FloatRectangle rect = GetBoundsF();
return true;
}
- if (!__singleHandler)
- {
- previousCursorPos = __pCopyPasteManager->GetCursorPosition();
- }
-
FloatPoint absoluteTouchMovedPoint = FloatPoint(GetBoundsF().x + point.x, GetBoundsF().y + point.y);
if (__handlerDirection == HANDLER_DIRECTION_REVERSE_2 || __handlerDirection == HANDLER_DIRECTION_REVERSE_3)
{
}
else
{
- __pCopyPasteManager->SetCursorPosition(previousCursorPos);
- pEditPresenter->SetCursorChangedFlag(!__leftHandler);
return true;
}
}
{
if (point.x - __touchPressedPoint.x == 0.0f)
{
- __pCopyPasteManager->SetCursorPosition(previousCursorPos);
- pEditPresenter->SetCursorChangedFlag(!__leftHandler);
return true;
}
}
if (point.y < 0.0f || (point.y > GetBoundsF().height))
{
- __pCopyPasteManager->SetCursorPosition(previousCursorPos);
- pEditPresenter->SetCursorChangedFlag(!__leftHandler);
return true;
}
}
}
else
{
- __pCopyPasteManager->SetCursorPosition(previousCursorPos);
- pEditPresenter->SetCursorChangedFlag(!__leftHandler);
return true;
}
}
if (!__singleHandler && !__pCopyPasteManager->CheckHandlePosition(__leftHandler, cursorPos))
{
- __pCopyPasteManager->SetCursorPosition(previousCursorPos);
- pEditPresenter->SetCursorChangedFlag(!__leftHandler);
+ if ((__pCopyPasteManager->GetEdit()->GetEditStyle() & EDIT_STYLE_SINGLE_LINE))
+ {
+ _EditCopyPasteManager::HandlerType nextHandlerType = _EditCopyPasteManager::HANDLER_TYPE_MAX;
+ if (__leftHandler)
+ {
+ nextHandlerType = _EditCopyPasteManager::HANDLER_TYPE_RIGHT;
+ }
+ else
+ {
+ nextHandlerType = _EditCopyPasteManager::HANDLER_TYPE_LEFT;
+ }
+ int nextHandler = __pCopyPasteManager->GetHandlerCursorPosition(nextHandlerType);
+ if (Math::Abs(nextHandler - __handlerCursorPos) <= 1)
+ {
+ pTextObject->SetFirstDisplayLineIndexFromTextIndex(nextHandler);
+ }
+ }
return true;
}
if (cursorPos == -1 || __handlerCursorPos == cursorPos)
{
- if (__singleHandler)
+ if (!__singleHandler && (__pCopyPasteManager->GetEdit()->GetEditStyle() & EDIT_STYLE_SINGLE_LINE))
{
- return true;
+ _EditCopyPasteManager::HandlerType nextHandlerType = _EditCopyPasteManager::HANDLER_TYPE_MAX;
+ if (__leftHandler)
+ {
+ nextHandlerType = _EditCopyPasteManager::HANDLER_TYPE_RIGHT;
+ }
+ else
+ {
+ nextHandlerType = _EditCopyPasteManager::HANDLER_TYPE_LEFT;
+ }
+ int nextHandler = __pCopyPasteManager->GetHandlerCursorPosition(nextHandlerType);
+ if (Math::Abs(nextHandler - __handlerCursorPos) <= 1)
+ {
+ pTextObject->SetFirstDisplayLineIndexFromTextIndex(nextHandler);
+ }
}
- __pCopyPasteManager->SetCursorPosition(previousCursorPos);
- pEditPresenter->SetCursorChangedFlag(!__leftHandler);
return true;
}
if (cursorBounds.x != -1)
{
cursorBounds.x -= 1;
- cursorBounds.width = 2*cursorBounds.width;
+ cursorBounds.width = cursorBounds.width;
cursorBounds = cursorBounds.GetIntersection(textObjectBounds);
canvas.FillRectangle(textBlockLineColor, cursorBounds);
}
CalculateCursorBounds(__textObjectBounds, cursorBounds, lengthRange);
}
- if (cursorBounds.x != -1 && cursorBounds.x < __textObjectBounds.x + __textObjectBounds.width)
+ if (cursorBounds.x != -1 && cursorBounds.x <= __textObjectBounds.x + __textObjectBounds.width)
{
cursorBounds.x -= 1;
- cursorBounds.width = 2*cursorBounds.width;
+ cursorBounds.width = cursorBounds.width;
cursorBounds = cursorBounds.GetIntersection(textObjectBounds);
canvas.FillRectangle(textBlockLineColor, cursorBounds);
}
needToCreatePopup = false;
}
+ if (IsViewModeEnabled() && GetTextLength() == 0)
+ {
+ needToCreatePopup = false;
+ }
_AccessibilityManager* pAccessibilityManager = _AccessibilityManager::GetInstance();
SysTryReturn(NID_UI_CTRL, pAccessibilityManager, false, E_SYSTEM, "pAccessibilityManager is null");
if (pAccessibilityManager->IsActivated())
absCursorBounds.y = absBounds.y + cursorRelativeY;
}
+ GET_SHAPE_CONFIG(EDIT::CURSOR_WIDTH, __pEdit->GetOrientation(), cursorWidth);
+
absCursorBounds.width = cursorWidth;
if (cursorHeight > 0.0f)
absCursorBounds.y = absBounds.y + cursorRelativeY;
}
+ GET_SHAPE_CONFIG(EDIT::CURSOR_WIDTH, __pEdit->GetOrientation(), cursorWidth);
+
absCursorBounds.width = cursorWidth;
if (cursorHeight > 0.0f)