Accessibility changes for DateTimePicker & Fix for TDIS-5084.
authorsr.shashank <sr.shashank@samsung.com>
Tue, 9 Apr 2013 13:48:59 +0000 (19:18 +0530)
committersr.shashank <sr.shashank@samsung.com>
Wed, 10 Apr 2013 05:29:01 +0000 (10:59 +0530)
Change-Id: Id364aea5a6717f56d033e14f8e415762e6bfcacc
Signed-off-by: sr.shashank <sr.shashank@samsung.com>
src/ui/controls/FUiCtrl_DateTimePicker.cpp
src/ui/controls/FUiCtrl_DateTimePresenter.cpp

index b5578aa..c076b36 100644 (file)
@@ -813,11 +813,18 @@ _DateTimePicker::OnAttachedToMainTree(void)
        _AccessibilityContainer* pContainer = GetAccessibilityContainer();
        if (pContainer != null)
        {
-               pContainer->AddListener(*this);
-
+               float dateTimeDisplayBoxHeight = 0.0f;
+               float amPmDisplayBoxHeight = 0.0f;
+               float topMargin = 0.0f;
+               float leftMargin = 0.0f;
                const _DateTimeDisplayBox* pBox = null;
                const _DateTimeDisplayBox* pAmPmBox = null;
 
+               GET_SHAPE_CONFIG(DATETIMEPICKER::LEFT_MARGIN, GetOrientation(), leftMargin);
+
+               pContainer->AddListener(*this);
+
+               // Display Box
                for (int index = 0; index < DATETIME_ID_MAX; index++)
                {
                        pBox = __pPresenter->GetDisplayBox(index);
@@ -855,6 +862,14 @@ _DateTimePicker::OnAttachedToMainTree(void)
                                        break;
                                }
 
+                               GET_SHAPE_CONFIG(DATETIMEPICKER::DATETIME_DISPLAY_BOX_HEIGHT, GetOrientation(), dateTimeDisplayBoxHeight);
+                               GET_SHAPE_CONFIG(DATETIMEPICKER::AMPM_DISPLAY_BOX_HEIGHT, GetOrientation(), amPmDisplayBoxHeight);
+                               topMargin = (amPmDisplayBoxHeight - dateTimeDisplayBoxHeight) / 2.0f;
+
+                               displayBoxBounds.x += leftMargin;
+                               displayBoxBounds.y -= topMargin;
+                               displayBoxBounds.height += 2 * topMargin;
+
                                if (__pDisplayVisualElement)
                                {
                                        displayBoxBounds.y += __pDisplayVisualElement->GetBounds().y;
@@ -866,6 +881,7 @@ _DateTimePicker::OnAttachedToMainTree(void)
                        }
                }
 
+               // AmPm Button
                String hintAmPmText(L"Double tap to change");
 
                pAmPmBox = __pPresenter->GetAmPmBox();
@@ -876,6 +892,8 @@ _DateTimePicker::OnAttachedToMainTree(void)
 
                        FloatRectangle amPmBoxBounds = pAmPmBox->GetDisplayBoxBounds();
 
+                       amPmBoxBounds.x += leftMargin;
+
                        if (__pDisplayVisualElement)
                        {
                                amPmBoxBounds.y += __pDisplayVisualElement->GetBounds().y;
index cf7df89..3b95377 100755 (executable)
@@ -1371,6 +1371,11 @@ _DateTimePresenter::DrawBackground(Canvas& canvas)
 {
        result r = E_SUCCESS;
        FloatRectangle bounds = canvas.GetBoundsF();
+       Color backgroundColor(0, 0, 0, 0);
+
+       GET_COLOR_CONFIG(DATETIMEPICKER::BG_NORMAL, backgroundColor);
+       canvas.SetBackgroundColor(backgroundColor);
+       canvas.Clear();
 
        if (__pBgEffectBitmap)
        {