From: Bhavya Kumili Date: Wed, 11 Sep 2013 15:07:25 +0000 (+0530) Subject: [Fix for N_SE-51938]Resetting Am/Pm button status in OnFocusLost and EditTime fixes X-Git-Tag: accepted/tizen/20131002.165803^2~143^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6a94ccb0b54685ce815cf00fd005e6d00b2ef3be;p=platform%2Fframework%2Fnative%2Fuifw.git [Fix for N_SE-51938]Resetting Am/Pm button status in OnFocusLost and EditTime fixes Signed-off-by: Bhavya Kumili Change-Id: Icae842932ae72785c6d1d733374568b4636f7417 --- diff --git a/src/ui/controls/FUiCtrl_DateTimePresenter.cpp b/src/ui/controls/FUiCtrl_DateTimePresenter.cpp index 46b454b..768d4df 100644 --- a/src/ui/controls/FUiCtrl_DateTimePresenter.cpp +++ b/src/ui/controls/FUiCtrl_DateTimePresenter.cpp @@ -878,7 +878,15 @@ _DateTimePresenter::ReleaseFocus(void) } __focusedBoxIndex = 0; + if (__isPmButtonPressed) + { + __isPmButtonPressed = false; + } + __inputComposing = DATETIME_INPUT_END; + __changeFocusCounter = DATE_TIME_CHANGE_FOCUS_COUNTER_MIN; + AdjustDisplayValue(__selectedBoxIndex); __pView->Invalidate(true); + return r; } diff --git a/src/ui/controls/FUiCtrl_EditTimePresenter.cpp b/src/ui/controls/FUiCtrl_EditTimePresenter.cpp index dc2cc9f..7561f3b 100644 --- a/src/ui/controls/FUiCtrl_EditTimePresenter.cpp +++ b/src/ui/controls/FUiCtrl_EditTimePresenter.cpp @@ -918,21 +918,11 @@ _EditTimePresenter::DrawContentBitmap(Canvas& canvas, const FloatRectangle& boun pReplacementBitmap = __pContentBgDisabledColorReplacementBitmap; pEffectBitmap = __pContentBgEffectDisabledBitmap; } - else if (__selectedId != boxId) + else if (GetLastSelectedId() != boxId) { - if (__pEditTime->GetDateTimeBar() != null && __pEditTime->GetDateTimeBar()->IsActivated() && - (GetLastSelectedId() == boxId)) - { - isCustomBitmap = IS_CUSTOM_BITMAP(EDITTIME::CONTENT_BG_PRESSED); - pReplacementBitmap = __pContentBgPressedColorReplacementBitmap; - pEffectBitmap = __pContentBgEffectPressedBitmap; - } - else - { - isCustomBitmap = IS_CUSTOM_BITMAP(EDITTIME::CONTENT_BG_NORMAL); - pReplacementBitmap = __pContentBgNormalColorReplacementBitmap; - pEffectBitmap = __pContentBgEffectNormalBitmap; - } + isCustomBitmap = IS_CUSTOM_BITMAP(EDITTIME::CONTENT_BG_NORMAL); + pReplacementBitmap = __pContentBgNormalColorReplacementBitmap; + pEffectBitmap = __pContentBgEffectNormalBitmap; } else { @@ -976,30 +966,23 @@ _EditTimePresenter::DrawText(Canvas& canvas, const FloatRectangle& bounds, const { GET_COLOR_CONFIG(EDITTIME::TEXT_NORMAL, textColor); - if (__pEditTime->GetDateTimeBar() != null && __pEditTime->GetDateTimeBar()->IsActivated() && - (GetLastSelectedId() == boxId)) - { - GET_COLOR_CONFIG(EDITTIME::TEXT_PRESSED, textColor); - (_FontImpl::GetInstance(*__pFont))->SetStyle(FONT_STYLE_BOLD); - } - if (boxId == DATETIME_ID_AMPM) { - GET_COLOR_CONFIG(EDITTIME::BUTTON_TEXT_NORMAL, textColor); - } - - if (boxId > -1 && boxId == __selectedId) - { - if (boxId == DATETIME_ID_AMPM) + if (boxId == __selectedId) { GET_COLOR_CONFIG(EDITTIME::BUTTON_TEXT_PRESSED, textColor); } else { - GET_COLOR_CONFIG(EDITTIME::TEXT_PRESSED, textColor); - (_FontImpl::GetInstance(*__pFont))->SetStyle(FONT_STYLE_BOLD); + GET_COLOR_CONFIG(EDITTIME::BUTTON_TEXT_NORMAL, textColor); } } + + else if (boxId > -1 && boxId == GetLastSelectedId()) + { + GET_COLOR_CONFIG(EDITTIME::TEXT_PRESSED, textColor); + (_FontImpl::GetInstance(*__pFont))->SetStyle(FONT_STYLE_BOLD); + } } if (boxId != DATETIME_ID_AMPM) @@ -1197,6 +1180,19 @@ _EditTimePresenter::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo __pEditTime->Invalidate(); break; } + case _KEY_ENTER: + { + if (__focusId == DATETIME_ID_AMPM) + { + __selectedId = DATETIME_ID_AMPM; + __pEditTime->Invalidate(); + } + else + { + return false; + } + break; + } default: { @@ -1292,6 +1288,7 @@ _EditTimePresenter::OnKeyReleased(const _Control& source, const _KeyCode& keyCod SetAmEnabled(!GetAmEnabled()); __pEditTime->FireTimeChangeEvent(TIME_INTERNAL_CHANGE_SAVED); boxId = DATETIME_ID_AMPM; + __selectedId = DATETIME_ID_NONE; __pEditTime->Invalidate(); }