Chage get orientation status for popup
authorkeonpyo.kong <keonpyo.kong@samsung.com>
Mon, 1 Apr 2013 06:15:35 +0000 (15:15 +0900)
committerkeonpyo.kong <keonpyo.kong@samsung.com>
Mon, 1 Apr 2013 06:15:43 +0000 (15:15 +0900)
Change-Id: I974f867dc39cc5b68f5db9f6494a6f1032d59809
Signed-off-by: keonpyo.kong <keonpyo.kong@samsung.com>
src/ui/FUi_ControlImpl.cpp
src/ui/FUi_ControlImplManager.cpp
src/ui/controls/FUiCtrl_PopupImpl.cpp

index e5d4a3d..6670015 100755 (executable)
@@ -3569,22 +3569,15 @@ void
     {
         if (IsAttachedToMainTree())
         {
-            _ControlImplManager* pControlImplManager = _ControlImplManager::GetInstance();
-            OrientationStatus orientation = pControlImplManager->GetFormOrientationStatus(this);
+               controlOrientation = GetCore().GetOrientation();
 
-            if (orientation == ORIENTATION_STATUS_NONE)
+               if (controlOrientation == _CONTROL_ORIENTATION_LANDSCAPE)
+               {
+                       SetBuilderBounds(_CONTROL_ORIENTATION_LANDSCAPE, bounds);
+               }
+               else
             {
-                return;
-            }
-
-            if (orientation == ORIENTATION_STATUS_LANDSCAPE
-                || orientation == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
-            {
-                SetBuilderBounds(_CONTROL_ORIENTATION_LANDSCAPE, bounds);
-            }
-            else
-            {
-                SetBuilderBounds(_CONTROL_ORIENTATION_PORTRAIT, bounds);
+                               SetBuilderBounds(_CONTROL_ORIENTATION_PORTRAIT, bounds);
             }
         }
         else
@@ -3599,16 +3592,8 @@ void
 _ControlImpl::UpdateBuilderSize(const Tizen::Graphics::FloatDimension& dimension)
 {
        FloatRectangle builderBounds;
-       _ControlOrientation controlOrientation = _CONTROL_ORIENTATION_PORTRAIT;
-       _ControlImplManager* pControlImplManager = _ControlImplManager::GetInstance();
-       OrientationStatus orientation = pControlImplManager->GetFormOrientationStatus(this);
-
-       if (orientation == ORIENTATION_STATUS_LANDSCAPE
-       || orientation == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
-       {
-               controlOrientation = _CONTROL_ORIENTATION_LANDSCAPE;
-       }
-
+       _ControlOrientation controlOrientation = GetCore().GetOrientation();
+       
        bool exist = GetBuilderBoundsF(controlOrientation, builderBounds);
        if (exist)
        {
index c3666bd..c878d70 100644 (file)
@@ -338,19 +338,6 @@ _ControlImplManager::GetFormOrientationStatus(_ControlImpl* pControlImpl)
        {
                orientation = pParentImpl->GetOrientationStatus();
        }
-       else
-       {
-               _PopupImpl* pPopImpl = dynamic_cast<Tizen::Ui::Controls::_PopupImpl*>(pTempControlImpl);
-               Form* pForm = null;
-               if (pPopImpl)
-               {
-                       pForm = dynamic_cast<Tizen::Ui::Controls::Form*>(pPopImpl->GetOwner());
-                       if (pForm)
-                       {
-                               orientation = pForm->GetOrientationStatus();
-                       }
-               }
-       }
 
        return orientation;
 }
index 0c69a40..5104acb 100644 (file)
@@ -307,16 +307,12 @@ _PopupImpl::GetXmlBounds(Tizen::Graphics::FloatRectangle& rect)
                return false;
        }
 
-       _ControlImplManager* pControlImplManager = _ControlImplManager::GetInstance();
-       OrientationStatus orientation = pControlImplManager->GetFormOrientationStatus(this);
+       controlOrientation = GetCore().GetOrientation();
 
-       if (orientation == ORIENTATION_STATUS_LANDSCAPE
-                       || orientation == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
+       if (controlOrientation == _CONTROL_ORIENTATION_LANDSCAPE)
        {
-                       controlOrientation = _CONTROL_ORIENTATION_LANDSCAPE;
-                       this->GetBuilderBounds(controlOrientation, builderBounds);
+               GetBuilderBounds(controlOrientation, builderBounds);
        }
-
        rect = _CoordinateSystemUtils::ConvertToFloat(builderBounds);
 
        return true;