From: Myung Jin Kim Date: Mon, 8 Jul 2013 15:33:08 +0000 (+0900) Subject: fix jira defect for butto and toolbar X-Git-Tag: accepted/tizen/20130924.144426~1^2~127^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5cb11feaf78a7b405ddb07b0ba3c803cbfaa778f;p=platform%2Fframework%2Fnative%2Fuifw.git fix jira defect for butto and toolbar Change-Id: I686c291cf1f319a8b60fc0cb53814774f03db688 --- diff --git a/src/ui/controls/FUiCtrl_Button.cpp b/src/ui/controls/FUiCtrl_Button.cpp index a8f0bb0..414d249 100644 --- a/src/ui/controls/FUiCtrl_Button.cpp +++ b/src/ui/controls/FUiCtrl_Button.cpp @@ -1296,14 +1296,7 @@ _Button::SetButtonStatus(_ButtonStatus buttonStatus, bool fire) _ButtonStatus _Button::GetButtonStatus(void) const { - _ButtonStatus status = __buttonStatus; - - if (IsEnabled() == false && status != _BUTTON_STATUS_SELECTED) - { - status = _BUTTON_STATUS_DISABLED; - } - - return status; + return __buttonStatus; } result diff --git a/src/ui/controls/FUiCtrl_ButtonPresenter.cpp b/src/ui/controls/FUiCtrl_ButtonPresenter.cpp index a704d2f..7616306 100644 --- a/src/ui/controls/FUiCtrl_ButtonPresenter.cpp +++ b/src/ui/controls/FUiCtrl_ButtonPresenter.cpp @@ -1190,16 +1190,21 @@ _ButtonPresenter::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo) void _ButtonPresenter::OnAncestorEnableStateChanged(const _Control& control) { - if (!__pButton->IsEnabled()) + if (__pButton->GetButtonStatus() == _BUTTON_STATUS_SELECTED) { return; } - if (__pButton->GetButtonStatus() == _BUTTON_STATUS_PRESSED) + if (__pButton->IsEnabled()) { __pButton->SetButtonStatus(_BUTTON_STATUS_NORMAL); __pButton->Invalidate(); } + else + { + __pButton->SetButtonStatus(_BUTTON_STATUS_DISABLED); + __pButton->Invalidate(); + } return; } diff --git a/src/ui/controls/FUiCtrl_Toolbar.cpp b/src/ui/controls/FUiCtrl_Toolbar.cpp index 0b2e8cf..862c8ec 100644 --- a/src/ui/controls/FUiCtrl_Toolbar.cpp +++ b/src/ui/controls/FUiCtrl_Toolbar.cpp @@ -2472,6 +2472,7 @@ _Toolbar::SetItemHighlighted(int itemIndex, bool fire, bool adjust) __pItems.at(itemIndex)->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED, fire); __pItems.at(itemIndex)->ShowUnderlineBitmap(true); + __pItems.at(itemIndex)->Draw(); __highlightedItemIndex = itemIndex; __lastHighlightedItemIndex = __highlightedItemIndex; @@ -7123,7 +7124,15 @@ _Toolbar::RealignItem(_Button* pButton, float textExtentSize) } else { - pButton->SetUserDefinedTextArea(FloatRectangle(sideMargin, buttonTextTopMargin, buttonItemWidth - sideMargin * 2, buttonItemHeight - buttonTextTopMargin * 2)); + if (__style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE || __style == TOOLBAR_TAB_WITH_TITLE) + { + pButton->SetUserDefinedTextArea(FloatRectangle(sideMargin, (buttonItemHeight - largeTabTextHeight) / 2, + buttonItemWidth - sideMargin * 2, largeTabTextHeight)); + } + else + { + pButton->SetUserDefinedTextArea(FloatRectangle(sideMargin, buttonTextTopMargin, buttonItemWidth - sideMargin * 2, buttonItemHeight - buttonTextTopMargin * 2)); + } } } else