#include <FUiCtrlOverlayPanel.h>
#include <FIo_RegistryImpl.h>
-#include <FGrp_Screen.h>
+#include <FGrpCoordinateSystem.h>
#include <FSys_EnvironmentImpl.h>
#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;
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();
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();
_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();
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();