From fca4fd24045c5d4e25051ab599d7a242fbaa1de2 Mon Sep 17 00:00:00 2001 From: woo Date: Fri, 22 Mar 2013 21:48:50 +0900 Subject: [PATCH] fix checking logic to get valid size of overlaypanel(JIRA ISSUE : N_SE-29663, N_SE-29713) Change-Id: I31968616c22fb79c7d55d9fe05e5f4852fcf9bbb Signed-off-by: woo --- src/ui/controls/FUiCtrl_OverlayAgent.cpp | 4 ---- src/ui/controls/FUiCtrl_OverlayPanel.cpp | 2 -- src/ui/controls/FUiCtrl_OverlayPanelImpl.cpp | 26 +++++++++++++------------- src/ui/inc/FUiCtrl_OverlayAgent.h | 22 +++++----------------- 4 files changed, 18 insertions(+), 36 deletions(-) diff --git a/src/ui/controls/FUiCtrl_OverlayAgent.cpp b/src/ui/controls/FUiCtrl_OverlayAgent.cpp index 21ca3c0..f95966e 100644 --- a/src/ui/controls/FUiCtrl_OverlayAgent.cpp +++ b/src/ui/controls/FUiCtrl_OverlayAgent.cpp @@ -43,11 +43,7 @@ extern "C"{ #include #include -#include -#include -#include #include - #include #include #include diff --git a/src/ui/controls/FUiCtrl_OverlayPanel.cpp b/src/ui/controls/FUiCtrl_OverlayPanel.cpp index 9e727e1..2d67a12 100644 --- a/src/ui/controls/FUiCtrl_OverlayPanel.cpp +++ b/src/ui/controls/FUiCtrl_OverlayPanel.cpp @@ -298,8 +298,6 @@ void _OverlayPanel::OnBoundsChanged(void) { SysTryReturnVoidResult(NID_UI_CTRL, __pOverlayAgent != null, E_SYSTEM, "[E_SYSTEM] OverlayAgent must not be null."); - - //To do } void diff --git a/src/ui/controls/FUiCtrl_OverlayPanelImpl.cpp b/src/ui/controls/FUiCtrl_OverlayPanelImpl.cpp index 9950f1b..817b22d 100644 --- a/src/ui/controls/FUiCtrl_OverlayPanelImpl.cpp +++ b/src/ui/controls/FUiCtrl_OverlayPanelImpl.cpp @@ -25,15 +25,15 @@ #include #include -#include +#include #include #include "FUi_CoordinateSystemUtils.h" +#include "FUi_ControlManager.h" #include "FUi_ResourceSizeInfo.h" #include "FUi_UiBuilder.h" #include "FUiCtrl_OverlayAgent.h" #include "FUiCtrl_OverlayPanelImpl.h" - using namespace Tizen::Base; using namespace Tizen::Base::Collection; using namespace Tizen::Graphics; @@ -63,22 +63,22 @@ _OverlayPanelImpl::OverlayPanelSizeInfo::GetDefaultMinimumSize(_ControlOrientati Dimension _OverlayPanelImpl::OverlayPanelSizeInfo::GetDefaultMaximumSize(_ControlOrientation orientation) const { - Dimension screenSize = Dimension(_Screen::GetWidth(), _Screen::GetHeight()); - Dimension overlayPanelMaxSize = screenSize; + Dimension overlayPanelMaxSize = CoordinateSystem::GetLogicalResolution(); - if (orientation == _CONTROL_ORIENTATION_LANDSCAPE) + if (orientation == _CONTROL_ORIENTATION_PORTRAIT) { - overlayPanelMaxSize.width = screenSize.height; - overlayPanelMaxSize.height = screenSize.width; + return overlayPanelMaxSize; + } + else + { + return Dimension(overlayPanelMaxSize.height, overlayPanelMaxSize.width); } - - return overlayPanelMaxSize; } _OverlayPanelImpl* _OverlayPanelImpl::CreateOverlayPanelImplN(OverlayPanel* pPublic, const Rectangle& bounds) { - result r = GET_SIZE_INFO(OverlayPanel).CheckInitialSizeValid(Dimension(bounds.width, bounds.height), _CONTROL_ORIENTATION_PORTRAIT); + result r = GET_SIZE_INFO(OverlayPanel).CheckInitialSizeValid(Dimension(bounds.width, bounds.height), _ControlManager::GetInstance()->GetOrientation()); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, E_INVALID_ARG, "[E_INVALID_ARG] The size of overlay panel(%d, %d) is invalid.", bounds.width, bounds.height); _OverlayPanel* pCore = _OverlayPanel::CreateOverlayPanelN(); @@ -89,7 +89,7 @@ _OverlayPanelImpl::CreateOverlayPanelImplN(OverlayPanel* pPublic, const Rectangl r = _ControlImpl::CheckConstruction(pCore, pImpl.get()); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); - r = pImpl->InitializeBoundsProperties(GET_SIZE_INFO(OverlayPanel), bounds, _CONTROL_ORIENTATION_PORTRAIT); + r = pImpl->InitializeBoundsProperties(GET_SIZE_INFO(OverlayPanel), bounds, _ControlManager::GetInstance()->GetOrientation()); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); return pImpl.release(); @@ -98,7 +98,7 @@ _OverlayPanelImpl::CreateOverlayPanelImplN(OverlayPanel* pPublic, const Rectangl _OverlayPanelImpl* _OverlayPanelImpl::CreateOverlayPanelImplN(OverlayPanel* pPublic, const FloatRectangle& bounds) { - result r = GET_SIZE_INFO(OverlayPanel).CheckInitialSizeValid(Dimension(bounds.width, bounds.height), _CONTROL_ORIENTATION_PORTRAIT); + result r = GET_SIZE_INFO(OverlayPanel).CheckInitialSizeValid(Dimension(bounds.width, bounds.height), _ControlManager::GetInstance()->GetOrientation()); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, E_INVALID_ARG, "[E_INVALID_ARG] The size of overlay panel(%d, %d) is invalid.", bounds.width, bounds.height); _OverlayPanel* pCore = _OverlayPanel::CreateOverlayPanelN(); @@ -109,7 +109,7 @@ _OverlayPanelImpl::CreateOverlayPanelImplN(OverlayPanel* pPublic, const FloatRec r = _ControlImpl::CheckConstruction(pCore, pImpl.get()); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); - r = pImpl->InitializeBoundsPropertiesF(GET_SIZE_INFO(OverlayPanel), bounds, _CONTROL_ORIENTATION_PORTRAIT); + r = pImpl->InitializeBoundsPropertiesF(GET_SIZE_INFO(OverlayPanel), bounds, _ControlManager::GetInstance()->GetOrientation()); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); return pImpl.release(); diff --git a/src/ui/inc/FUiCtrl_OverlayAgent.h b/src/ui/inc/FUiCtrl_OverlayAgent.h index f09e2cf..ca0c4fa 100644 --- a/src/ui/inc/FUiCtrl_OverlayAgent.h +++ b/src/ui/inc/FUiCtrl_OverlayAgent.h @@ -33,23 +33,11 @@ #include #include - -namespace Tizen { namespace Base -{ -class ByteBuffer; -}} // Tizen::Base - -namespace Tizen { namespace Graphics -{ -class BufferInfo; -class Dimension; -class Rectangle; -}} // Tizen::Graphics - -namespace Tizen { namespace Ui -{ -class _Controls; -}} // Tizen::Ui +#include +#include +#include +#include +#include namespace Tizen { namespace Ui { namespace Animations { -- 2.7.4