fixed bug(N_SE-42977)
authorChulheon <ch.jeong47@samsung.com>
Wed, 26 Jun 2013 00:20:42 +0000 (09:20 +0900)
committerChulheon <ch.jeong47@samsung.com>
Wed, 26 Jun 2013 00:20:42 +0000 (09:20 +0900)
Change-Id: I94f1e20865e7bc0d2d58aea069fbbe274aee5950

src/ui/controls/FUiCtrl_EditCopyPasteManager.cpp
src/ui/controls/FUiCtrl_EditPresenter.cpp
src/ui/controls/FUiCtrl_Keypad.cpp
src/ui/resource/FUi_ResourceEditConfig.cpp

index 582705e..dd1544b 100644 (file)
@@ -23,6 +23,7 @@
 #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"
@@ -43,6 +44,7 @@ using namespace Tizen::Ui;
 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;
@@ -874,7 +876,6 @@ _EditCopyPasteHandler::AdjustBounds(void)
        FloatPoint checkPoint(0.0f, 0.0f);
        _Edit* pEdit = __pCopyPasteManager->GetEdit();
        _EditPresenter* pEditPresenter = pEdit->GetPresenter();
-       TextObject* pTextObject = pEditPresenter->GetTextObject();
 
        if (__singleHandler)
        {
@@ -908,15 +909,7 @@ _EditCopyPasteHandler::AdjustBounds(void)
                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)
                {
@@ -1277,7 +1270,6 @@ bool
 _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();
@@ -1315,11 +1307,6 @@ _EditCopyPasteHandler::OnTouchMoved(const _Control& source, const _TouchInfo& to
                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)
        {
@@ -1450,8 +1437,6 @@ _EditCopyPasteHandler::OnTouchMoved(const _Control& source, const _TouchInfo& to
                                                        }
                                                        else
                                                        {
-                                                               __pCopyPasteManager->SetCursorPosition(previousCursorPos);
-                                                               pEditPresenter->SetCursorChangedFlag(!__leftHandler);
                                                                return true;
                                                        }
                                                }
@@ -1481,8 +1466,6 @@ _EditCopyPasteHandler::OnTouchMoved(const _Control& source, const _TouchInfo& to
                        {
                                if (point.x - __touchPressedPoint.x == 0.0f)
                                {
-                                       __pCopyPasteManager->SetCursorPosition(previousCursorPos);
-                                       pEditPresenter->SetCursorChangedFlag(!__leftHandler);
                                        return true;
 
                                }
@@ -1516,8 +1499,6 @@ _EditCopyPasteHandler::OnTouchMoved(const _Control& source, const _TouchInfo& to
                                }
                                if (point.y < 0.0f || (point.y > GetBoundsF().height))
                                {
-                                       __pCopyPasteManager->SetCursorPosition(previousCursorPos);
-                                       pEditPresenter->SetCursorChangedFlag(!__leftHandler);
                                        return true;
                                }
                        }
@@ -1551,8 +1532,6 @@ _EditCopyPasteHandler::OnTouchMoved(const _Control& source, const _TouchInfo& to
                                                        }
                                                        else
                                                        {
-                                                               __pCopyPasteManager->SetCursorPosition(previousCursorPos);
-                                                               pEditPresenter->SetCursorChangedFlag(!__leftHandler);
                                                                return true;
                                                        }
                                                }
@@ -1594,19 +1573,45 @@ _EditCopyPasteHandler::OnTouchMoved(const _Control& source, const _TouchInfo& to
 
        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;
        }
 
index ba2a07f..4bd13c8 100755 (executable)
@@ -1938,7 +1938,7 @@ _EditPresenter::DrawTextBlockLine(Canvas& canvas)
        if (cursorBounds.x != -1)
        {
                cursorBounds.x -= 1;
-               cursorBounds.width = 2*cursorBounds.width;
+               cursorBounds.width = cursorBounds.width;
                cursorBounds = cursorBounds.GetIntersection(textObjectBounds);
                canvas.FillRectangle(textBlockLineColor, cursorBounds);
        }
@@ -1959,10 +1959,10 @@ _EditPresenter::DrawTextBlockLine(Canvas& canvas)
                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);
        }
@@ -3290,6 +3290,10 @@ _EditPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchI
                                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())
@@ -6493,6 +6497,8 @@ _EditPresenter::CalculateAbsoluteCursorBounds(int index, FloatRectangle& absCurs
                absCursorBounds.y = absBounds.y + cursorRelativeY;
        }
 
+       GET_SHAPE_CONFIG(EDIT::CURSOR_WIDTH, __pEdit->GetOrientation(), cursorWidth);
+
        absCursorBounds.width = cursorWidth;
 
        if (cursorHeight > 0.0f)
@@ -6546,6 +6552,8 @@ _EditPresenter::CalculateAbsoluteCursorBounds(int rowIndex, int columnIndex, Flo
                absCursorBounds.y = absBounds.y + cursorRelativeY;
        }
 
+       GET_SHAPE_CONFIG(EDIT::CURSOR_WIDTH, __pEdit->GetOrientation(), cursorWidth);
+
        absCursorBounds.width = cursorWidth;
 
        if (cursorHeight > 0.0f)
index 8de4f56..1855b72 100755 (executable)
@@ -858,6 +858,7 @@ _Keypad::OnChangeLayout(_ControlOrientation orientation)
                {
                        GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, GetOrientation(), indicatorheight);
                        __pIndicator->SetBounds(FloatRectangle(0.0f, 0.0f, portraitSize.width, indicatorheight));
+                       __pIndicator->SetIndicatorShowState(true);
                }
                else
                {
index 8d088c1..26c51b2 100644 (file)
@@ -122,7 +122,7 @@ START_UI_CONFIG(EDIT);
        ADD_SHAPE_CONFIG(AREA_TITLE_RECT_WIDTH, 120);
        ADD_SHAPE_CONFIG(AREA_TITLE_RECT_HEIGHT, 48);
        ADD_SHAPE_CONFIG(AREA_SCROLL_WIDTH, 5);
-       ADD_SHAPE_CONFIG(CURSOR_WIDTH, 2);
+       ADD_SHAPE_CONFIG(CURSOR_WIDTH, 4);
        ADD_SHAPE_CONFIG(TEXT_OBJECT_MININMUM_WIDTH, 63);
        ADD_SHAPE_CONFIG(TEXT_OBJECT_MININMUM_HEIGHT, 44);
        ADD_SHAPE_CONFIG(COPYPASTE_MAGNIFIER_WIDTH, 324);