Fxied indicator bug.
authorKeuckdo Bang <keuckdo.bang@samsung.net>
Tue, 4 Jun 2013 07:45:27 +0000 (16:45 +0900)
committerKeuckdo Bang <keuckdo.bang@samsung.net>
Tue, 4 Jun 2013 07:45:27 +0000 (16:45 +0900)
Change-Id: Ia6613db62738ed5ed3f0a58e717654a91bf15d9b

src/ui/controls/FUiCtrl_FormImpl.cpp
src/ui/controls/FUiCtrl_Indicator.cpp
src/ui/controls/FUiCtrl_Popup.cpp
src/ui/inc/FUiCtrl_Indicator.h

index ae7504a..fe6d046 100644 (file)
@@ -1218,9 +1218,9 @@ _FormImpl::OnChangeLayout(_ControlOrientation orientation)
        float indicatorheight = 0.0f;
 
        GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, GetCore().GetOrientation(), indicatorheight);
+       _Indicator* pIndicator = GetCore().GetIndicator();
        if (GetCore().HasIndicator())
        {
-               _Indicator* pIndicator = GetCore().GetIndicator();
                if (pIndicator)
                {
                        if (orientation == _CONTROL_ORIENTATION_PORTRAIT)
@@ -1233,9 +1233,12 @@ _FormImpl::OnChangeLayout(_ControlOrientation orientation)
                                pIndicator->SetBounds(FloatRectangle(0.0f, 0.0f, GetClientBoundsF().width, indicatorheight));
                        }
                }
-               pIndicator->OnChangeLayout(orientation);
                GetCore().AdjustClientBounds();
        }
+       if (pIndicator)
+       {
+               pIndicator->OnChangeLayout(orientation);
+       }
 
 
        float adjHeight = 0.0f;
index 54a2793..777694a 100644 (file)
@@ -75,9 +75,6 @@ _Indicator::CreateIndicator(void)
        r = pIndicator->ConstructControlVisualElement();
        SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
 
-       pIndicator->SetSurfaceOpaque(false);
-       pIndicator->SetOpacity(1.0f);
-
        pIndicator->SetBackgroundColor(_Colorf((float)bgColor.GetRed() / 255.0f, (float)bgColor.GetGreen() / 255.0f, (float)bgColor.GetBlue() / 255.0f, (float)bgColor.GetAlpha() / 255.0f));
 
        return pIndicator;
@@ -97,6 +94,7 @@ _Indicator::_Indicator(void)
        , __pWindow(null)
        , __showstate(false)
        , __opacity(_INDICATOR_OPACITY_OPAQUE)
+       , __orientation(_CONTROL_ORIENTATION_PORTRAIT)
 {
 }
 
@@ -156,9 +154,7 @@ _Indicator::SetIndicatorOpacity(_IndicatorOpacity opacity)
        }
        else if (opacity == _INDICATOR_OPACITY_TRANSLUCENT)
        {
-               _ControlOrientation orientation = __pWindow->GetOrientation();
-
-               if (orientation == _CONTROL_ORIENTATION_PORTRAIT)
+               if (__orientation == _CONTROL_ORIENTATION_PORTRAIT)
                {
                        Color bgColor(0x7f000000);
                        SetBackgroundColor(_Colorf((float)bgColor.GetRed() / 255.0f, (float)bgColor.GetGreen() / 255.0f, (float)bgColor.GetBlue() / 255.0f, (float)bgColor.GetAlpha() / 255.0f));
@@ -368,6 +364,7 @@ _Indicator::OnChangeLayout(_ControlOrientation orientation)
                ChangeCurrentVisualElement(__pLandscapeVisualElement);
                SetClipChildrenEnabled(false);
        }
+       __orientation = orientation;
        SetIndicatorOpacity(__opacity);
 
        _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
@@ -520,7 +517,7 @@ _Indicator::OnMessageHandle(Ecore_Evas *pEe, int msgDomain, int msgId, void *dat
                {
                        IndicatorTypeMode *pIndicatorTypeMode = (IndicatorTypeMode*)(data);
 
-                       _Window* pWindow =      _ControlManager::GetInstance()->_ControlManager::GetCurrentFrame();
+                       _Window* pWindow =      _ControlManager::GetInstance()->_ControlManager::GetTopVisibleWindow();
                        SysTryReturnVoidResult(NID_UI_CTRL, pWindow, E_INVALID_STATE, "[E_INVALID_STATE] Indicator is not attached main tree.");
 
                        Ecore_X_Window win = (Ecore_X_Window)pWindow->GetNativeHandle();
index 0f8804e..5a4661c 100644 (file)
@@ -89,6 +89,11 @@ _Popup::~_Popup(void)
                _pTitleTextAccessibilityElement->Activate(false);
                _pTitleTextAccessibilityElement = null;
        }
+
+       if (__pIndicator)
+       {
+               __pIndicator->Destroy();
+       }
 }
 
 _Popup*
index e9faf9d..76fd916 100644 (file)
@@ -65,8 +65,8 @@ public:
                Tizen::Graphics::Rectangle GetIndicatorBounds(void) const;
                Tizen::Graphics::FloatRectangle GetIndicatorBoundsF(void) const;
 
-               virtual void OnChangeLayout(_ControlOrientation orientation);
-               virtual result OnAttachedToMainTree(void);
+               void OnChangeLayout(_ControlOrientation orientation);
+               result OnAttachedToMainTree(void);
                virtual void OnTimerExpired(Tizen::Base::Runtime::Timer& timer);
                static void OnDisconnected(Ecore_Evas *pEe);
                static void OnMessageHandle(Ecore_Evas *pEe, int msgDomain, int msgId, void *data, int size);
@@ -85,6 +85,7 @@ private:
                _Window* __pWindow;
                bool __showstate;
                _IndicatorOpacity __opacity;
+               Tizen::Ui::_ControlOrientation __orientation;
 
 }; // _Indicator