Fix for N_SE-34569
authorSaravana Balaji <saravana.bs@samsung.com>
Mon, 15 Apr 2013 16:05:34 +0000 (21:35 +0530)
committerSaravana Balaji <saravana.bs@samsung.com>
Tue, 16 Apr 2013 05:03:32 +0000 (10:33 +0530)
Change-Id: Id7a544c5fa4623e5426a7b03db124df8c7896ccc
Signed-off-by: Saravana Balaji <saravana.bs@samsung.com>
src/ui/controls/FUiCtrl_SearchBar.cpp
src/ui/inc/FUiCtrl_SearchBar.h

index 796a91b..bfe5571 100644 (file)
@@ -78,6 +78,7 @@ _SearchBar::_SearchBar(void)
        , __pTextEvent(null)
        , __pSearchBarEvent(null)
        , __pLanguageEvent(null)
+       , __isupdateContentBounds(false)
 {
        for (int i = 0; i < SEARCHBAR_BUTTON_COLOR_MAX; i++)
        {
@@ -491,11 +492,11 @@ _SearchBar::SetContentsArea(void)
                height = pParent->GetClientBoundsF().height;
        }
 
-       __contentAreaBounds = GetBoundsF();
+       FloatRectangle controlBounds = GetBoundsF();
        __contentAreaBounds.x = 0.0f;
-       __contentAreaBounds.y = __contentAreaBounds.height;
-       __contentAreaBounds.width = width;
-       __contentAreaBounds.height = height - __contentAreaBounds.height;
+       __contentAreaBounds.y = controlBounds.height;
+       __contentAreaBounds.width = width - controlBounds.x;
+       __contentAreaBounds.height = height - (controlBounds.y + controlBounds.height);
 
        if (__pContainer)
        {
@@ -1538,6 +1539,7 @@ _SearchBar::OnBoundsChanged(void)
 {
        if (__pSearchBarPresenter != null)
        {
+               __isupdateContentBounds = true;
                __pSearchBarPresenter->OnBoundsChanged();
        }
        return;
@@ -1546,7 +1548,7 @@ _SearchBar::OnBoundsChanged(void)
 void
 _SearchBar::OnChangeLayout(_ControlOrientation orientation)
 {
-       SetContentsArea();
+       __isupdateContentBounds = true;
        return;
 }
 
@@ -1559,6 +1561,11 @@ _SearchBar::OnDraw(void)
                __pEdit->SetGuideTextColor(__guideTextColor[status]);
        }
 
+       if (__isupdateContentBounds)
+       {
+               SetContentsArea();
+               __isupdateContentBounds = false;
+       }
        __pSearchBarPresenter->Draw();
        return;
 }
@@ -1636,6 +1643,7 @@ _SearchBar::OnKeypadOpened(void)
        }
 
        __isKeypadOpening = false;
+       SetContentsArea();
        return;
 }
 
index ed78f3b..4445e07 100644 (file)
@@ -283,6 +283,7 @@ private:
        _Button* __pCancelButton;
        _Control* __pContainer;
        _Control* __pContentControl;
+       bool __isupdateContentBounds;
 
        int __actionId;
        int __searchBarStyle;