From 385a79f741c26acd2efc0112106231ba7f825905 Mon Sep 17 00:00:00 2001 From: "sr.shashank" Date: Tue, 9 Apr 2013 19:18:59 +0530 Subject: [PATCH] Accessibility changes for DateTimePicker & Fix for TDIS-5084. Change-Id: Id364aea5a6717f56d033e14f8e415762e6bfcacc Signed-off-by: sr.shashank --- src/ui/controls/FUiCtrl_DateTimePicker.cpp | 22 ++++++++++++++++++++-- src/ui/controls/FUiCtrl_DateTimePresenter.cpp | 5 +++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/ui/controls/FUiCtrl_DateTimePicker.cpp b/src/ui/controls/FUiCtrl_DateTimePicker.cpp index b5578aa..c076b36 100644 --- a/src/ui/controls/FUiCtrl_DateTimePicker.cpp +++ b/src/ui/controls/FUiCtrl_DateTimePicker.cpp @@ -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; diff --git a/src/ui/controls/FUiCtrl_DateTimePresenter.cpp b/src/ui/controls/FUiCtrl_DateTimePresenter.cpp index cf7df89..3b95377 100755 --- a/src/ui/controls/FUiCtrl_DateTimePresenter.cpp +++ b/src/ui/controls/FUiCtrl_DateTimePresenter.cpp @@ -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) { -- 2.7.4