Apply auto_hide style to popup.
authorkeuckdo.bang <keuckdo.bang@samsung.com>
Wed, 26 Jun 2013 13:29:14 +0000 (18:59 +0530)
committerkeuckdo.bang <keuckdo.bang@samsung.com>
Wed, 26 Jun 2013 13:29:14 +0000 (18:59 +0530)
Change-Id: Ie8131ac3876751da7ded35b6f0f68cebc93f6976

src/ui/controls/FUiCtrl_MessageBox.cpp
src/ui/controls/FUiCtrl_MessageBoxImpl.cpp
src/ui/controls/FUiCtrl_Popup.cpp
src/ui/controls/FUiCtrl_PopupImpl.cpp
src/ui/controls/FUiCtrl_ProgressPopup.cpp
src/ui/controls/FUiCtrl_ProgressPopupImpl.cpp
src/ui/inc/FUiCtrl_Popup.h

index f75d316..80d11f1 100644 (file)
@@ -437,7 +437,7 @@ _MessageBox::GetTotalHeight(void) const
 void
 _MessageBox::OnChangeLayout(_ControlOrientation orientation)
 {
-       _Window::OnChangeLayout(orientation);
+       _Popup::OnChangeLayout(orientation);
 
        result r = __pMsgboxPresenter->OnChangeLayout(orientation);
        SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
index 42569ac..8010f17 100644 (file)
@@ -288,26 +288,6 @@ _MessageBoxImpl::OnChangeLayout(_ControlOrientation orientation)
 
        SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
 
-       float indicatorheight = 0.0f;
-
-       const FloatDimension portraitSize = _ControlManager::GetInstance()->_ControlManager::GetScreenSizeF();
-       const FloatDimension landscapeSize = FloatDimension(portraitSize.height, portraitSize.width);
-
-       GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, GetCore().GetOrientation(), indicatorheight);
-       _Indicator* pIndicator = GetCore().GetIndicator();
-       if (pIndicator)
-       {
-               if (orientation == _CONTROL_ORIENTATION_PORTRAIT)
-               {
-                       pIndicator->SetBounds(FloatRectangle(0.0f - GetBoundsF().x, 0.0f - GetBoundsF().y, portraitSize.width, indicatorheight));
-               }
-               else
-               {
-                       GET_SHAPE_CONFIG(FORM::INDICATOR_MINIMIZE_HEIGHT, GetCore().GetOrientation(), indicatorheight);
-                       pIndicator->SetBounds(FloatRectangle(0.0f - GetBoundsF().x, 0.0f - GetBoundsF().y, landscapeSize.width, indicatorheight));
-               }
-               pIndicator->OnChangeLayout(orientation);
-       }
 
        return ;
 }
index 30af0ac..bcff38a 100644 (file)
@@ -501,7 +501,7 @@ _Popup::OnActivated(void)
 
        bool showstate = false;
        bool opacity = false;
-       bool autohide = false;
+       unsigned long formstyle = 0x00000000;
 
        _Control* pOwner = GetOwner();
        if (pOwner == null)
@@ -516,7 +516,7 @@ _Popup::OnActivated(void)
 
                        showstate = pForm->IsIndicatorVisible();
                        opacity = pForm->IsIndicatorTranslucent();
-                       autohide = pForm->IsIndicatorAutoHide();
+                       formstyle = pForm->GetFormStyle();
                }
                else
                {
@@ -530,7 +530,7 @@ _Popup::OnActivated(void)
                {
                        showstate = pForm->IsIndicatorVisible();
                        opacity = pForm->IsIndicatorTranslucent();
-                       autohide = pForm->IsIndicatorAutoHide();
+                       formstyle = pForm->GetFormStyle();
                }
 
                pOwner->LockInputEvent();
@@ -564,7 +564,40 @@ _Popup::OnActivated(void)
                {
                        __pIndicator->SetIndicatorOpacity(_INDICATOR_OPACITY_OPAQUE);
                }
-               //__pIndicator->SetIndicatorAutoHide(autohide);
+
+               if (formstyle & FORM_STYLE_PORTRAIT_INDICATOR)
+               {
+                       if (formstyle & FORM_STYLE_LANDSCAPE_INDICATOR_AUTO_HIDE)
+                       {
+                               __pIndicator->SetIndicatorAutoHide(false, true);
+                       }
+                       else
+                       {
+                               __pIndicator->SetIndicatorAutoHide(false, false);
+                       }
+               }
+               else if (formstyle & FORM_STYLE_INDICATOR_AUTO_HIDE)
+               {
+                       if (formstyle & FORM_STYLE_LANDSCAPE_INDICATOR_AUTO_HIDE)
+                       {
+                               __pIndicator->SetIndicatorAutoHide(true, true);
+                       }
+                       else
+                       {
+                               __pIndicator->SetIndicatorAutoHide(true, false);
+                       }
+               }
+               else
+               {
+                       if (formstyle & FORM_STYLE_LANDSCAPE_INDICATOR_AUTO_HIDE)
+                       {
+                               __pIndicator->SetIndicatorAutoHide(false, true);
+                       }
+                       else
+                       {
+                               __pIndicator->SetIndicatorAutoHide(false, false);
+                       }
+               }
        }
 
        _Window::OnActivated();
@@ -747,5 +780,46 @@ _Popup::IsRotationSynchronized(void) const
        return true;
 }
 
+void
+_Popup::OnChangeLayout(_ControlOrientation orientation)
+{
+       _Window::OnChangeLayout(orientation);
+
+       float indicatorheight = 0.0f;
+
+       const FloatDimension portraitSize = _ControlManager::GetInstance()->_ControlManager::GetScreenSizeF();
+       const FloatDimension landscapeSize = FloatDimension(portraitSize.height, portraitSize.width);
+
+       GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, GetOrientation(), indicatorheight);
+
+       _Form* pForm = dynamic_cast<_Form*>(GetOwner());
+       if (pForm)
+       {
+               if (__pIndicator)
+               {
+                       if (orientation == _CONTROL_ORIENTATION_PORTRAIT)
+                       {
+                               __pIndicator->SetBounds(FloatRectangle(0.0f, 0.0f, portraitSize.width, indicatorheight));
+                               if ((FORM_STYLE_INDICATOR & pForm->GetFormStyle()) || (FORM_STYLE_INDICATOR_AUTO_HIDE & pForm->GetFormStyle()))
+                               {
+                                       __pIndicator->SetIndicatorShowState(true);
+                               }
+                               else
+                               {
+                                       __pIndicator->SetIndicatorShowState(false);
+                               }
+                       }
+                       else
+                       {
+                               if (FORM_STYLE_LANDSCAPE_INDICATOR_AUTO_HIDE & pForm->GetFormStyle())
+                               {
+                                       __pIndicator->SetIndicatorShowState(true);
+                               }
+                       }
+                       __pIndicator->OnChangeLayout(orientation);
+               }
+       }
+}
+
 }}} // Tizen::Ui::Controls
 
index b3c0920..9863e43 100644 (file)
@@ -348,27 +348,6 @@ _PopupImpl::OnChangeLayout(_ControlOrientation orientation)
                }
        }
 
-       float indicatorheight = 0.0f;
-
-       const FloatDimension portraitSize = _ControlManager::GetInstance()->_ControlManager::GetScreenSizeF();
-       const FloatDimension landscapeSize = FloatDimension(portraitSize.height, portraitSize.width);
-
-       GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, GetCore().GetOrientation(), indicatorheight);
-       _Indicator* pIndicator = GetCore().GetIndicator();
-       if (pIndicator)
-       {
-               if (orientation == _CONTROL_ORIENTATION_PORTRAIT)
-               {
-                       pIndicator->SetBounds(FloatRectangle(0.0f, 0.0f, portraitSize.width, indicatorheight));
-               }
-               else
-               {
-                       GET_SHAPE_CONFIG(FORM::INDICATOR_MINIMIZE_HEIGHT, GetCore().GetOrientation(), indicatorheight);
-                       pIndicator->SetBounds(FloatRectangle(0.0f, 0.0f, landscapeSize.width, indicatorheight));
-               }
-               pIndicator->OnChangeLayout(orientation);
-       }
-
        return GetCore().OnChangeLayout(orientation);
 }
 
index d401fab..b9d3e06 100644 (file)
@@ -819,6 +819,7 @@ _ProgressPopup::OnActivated(void)
 
        bool showstate = false;
        bool opacity = false;
+       unsigned long formstyle = 0x00000000;
 
        _Control* pOwner = GetOwner();
        if (pOwner == null)
@@ -833,6 +834,7 @@ _ProgressPopup::OnActivated(void)
 
                        showstate = pForm->IsIndicatorVisible();
                        opacity = pForm->IsIndicatorTranslucent();
+                       formstyle = pForm->GetFormStyle();
                }
                else
                {
@@ -846,6 +848,7 @@ _ProgressPopup::OnActivated(void)
                {
                        showstate = pForm->IsIndicatorVisible();
                        opacity = pForm->IsIndicatorTranslucent();
+                       formstyle = pForm->GetFormStyle();
                }
 
                pOwner->LockInputEvent();
@@ -880,6 +883,40 @@ _ProgressPopup::OnActivated(void)
                {
                        pIndicator->SetIndicatorOpacity(_INDICATOR_OPACITY_OPAQUE);
                }
+
+               if (formstyle & FORM_STYLE_PORTRAIT_INDICATOR)
+               {
+                       if (formstyle & FORM_STYLE_LANDSCAPE_INDICATOR_AUTO_HIDE)
+                       {
+                               pIndicator->SetIndicatorAutoHide(false, true);
+                       }
+                       else
+                       {
+                               pIndicator->SetIndicatorAutoHide(false, false);
+                       }
+               }
+               else if (formstyle & FORM_STYLE_INDICATOR_AUTO_HIDE)
+               {
+                       if (formstyle & FORM_STYLE_LANDSCAPE_INDICATOR_AUTO_HIDE)
+                       {
+                               pIndicator->SetIndicatorAutoHide(true, true);
+                       }
+                       else
+                       {
+                               pIndicator->SetIndicatorAutoHide(true, false);
+                       }
+               }
+               else
+               {
+                       if (formstyle & FORM_STYLE_LANDSCAPE_INDICATOR_AUTO_HIDE)
+                       {
+                               pIndicator->SetIndicatorAutoHide(false, true);
+                       }
+                       else
+                       {
+                               pIndicator->SetIndicatorAutoHide(false, false);
+                       }
+               }
        }
 
 
@@ -962,7 +999,7 @@ _ProgressPopup::SetCancelButtonAccessibilityElement(void)
 void
 _ProgressPopup::OnChangeLayout(_ControlOrientation orientation)
 {
-       _Window::OnChangeLayout(orientation);
+       _Popup::OnChangeLayout(orientation);
 
        result r = E_SUCCESS;
 
index b58bb69..624fea1 100644 (file)
@@ -427,26 +427,6 @@ _ProgressPopupImpl::OnChangeLayout(_ControlOrientation orientation)
 
        SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
 
-       float indicatorheight = 0.0f;
-
-       const FloatDimension portraitSize = _ControlManager::GetInstance()->_ControlManager::GetScreenSizeF();
-       const FloatDimension landscapeSize = FloatDimension(portraitSize.height, portraitSize.width);
-
-       GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, GetCore().GetOrientation(), indicatorheight);
-       _Indicator* pIndicator = GetCore().GetIndicator();
-       if (pIndicator)
-       {
-               if (orientation == _CONTROL_ORIENTATION_PORTRAIT)
-               {
-                       pIndicator->SetBounds(FloatRectangle(0.0f, 0.0f, portraitSize.width, indicatorheight));
-               }
-               else
-               {
-                       GET_SHAPE_CONFIG(FORM::INDICATOR_MINIMIZE_HEIGHT, GetCore().GetOrientation(), indicatorheight);
-                       pIndicator->SetBounds(FloatRectangle(0.0f, 0.0f, landscapeSize.width, indicatorheight));
-               }
-               pIndicator->OnChangeLayout(orientation);
-       }
 
        return ;
 }
index 39f5266..1b5e865 100644 (file)
@@ -112,6 +112,8 @@ public:
        virtual void UpdateClientBounds(const Tizen::Graphics::FloatDimension& size, Tizen::Graphics::FloatRectangle& clientBounds);
        virtual bool IsRotationSynchronized(void) const;
 
+       virtual void OnChangeLayout(Tizen::Ui::_ControlOrientation orientation);
+
 // Accessor
 public:
        void SetColor(const Tizen::Graphics::Color& color);