From c22d3bcc159f2446ecde075cd5be1ad8acc83e50 Mon Sep 17 00:00:00 2001 From: DongJinJeon Date: Mon, 29 Apr 2013 13:10:08 +0900 Subject: [PATCH] remove minsize limitations of popup Change-Id: I04bd99779d70d866a7d5b0e2cf1511d28a1e89e6 Signed-off-by: DongJinJeon --- src/ui/controls/FUiCtrl_PopupImpl.cpp | 18 ------------------ src/ui/controls/FUiCtrl_PopupPresenter.cpp | 18 +++++++++++++----- src/ui/inc/FUi_ResourcePopupConfig.h | 1 + src/ui/resource/FUi_ResourcePopupConfig.cpp | 1 + 4 files changed, 15 insertions(+), 23 deletions(-) diff --git a/src/ui/controls/FUiCtrl_PopupImpl.cpp b/src/ui/controls/FUiCtrl_PopupImpl.cpp index 77feae1..d321009 100644 --- a/src/ui/controls/FUiCtrl_PopupImpl.cpp +++ b/src/ui/controls/FUiCtrl_PopupImpl.cpp @@ -125,24 +125,6 @@ _PopupImpl::Initialize(bool hasTitle, const Tizen::Graphics::FloatDimension& dim { result r = E_SUCCESS; - if (hasTitle) - { - FloatDimension minSize(0.0f, 0.0f); - - r = GET_DIMENSION_CONFIG(POPUP::MIN_SIZE_WITH_TITLE, GetCore().GetOrientation(), minSize); - - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] A system error occurred.", GetErrorMessage(r)); - - SysTryReturn(NID_UI_CTRL, - (minSize.width <= dim.width && minSize.height <= dim.height), E_INVALID_ARG, - E_INVALID_ARG, "[E_INVALID_ARG] The size is out of minimum size(%f, %f)", - minSize.width, minSize.height); - - r = GetCore().SetMinimumSize(minSize); - - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] SetMinimumSize is failed.", GetErrorMessage(r)); - } - FloatRectangle bounds = GetCenterAlignedRect(dim.width, dim.height); __init = true; _centerAlign = true; diff --git a/src/ui/controls/FUiCtrl_PopupPresenter.cpp b/src/ui/controls/FUiCtrl_PopupPresenter.cpp index e4585e7..416311c 100644 --- a/src/ui/controls/FUiCtrl_PopupPresenter.cpp +++ b/src/ui/controls/FUiCtrl_PopupPresenter.cpp @@ -29,6 +29,7 @@ #include #include "FUi_ControlManager.h" #include "FUi_CoordinateSystemUtils.h" +#include "FUi_Math.h" #include "FUi_ModalLoopManager.h" #include "FUi_ResourceManager.h" #include "FUi_UiTouchEvent.h" @@ -296,6 +297,9 @@ _PopupPresenter::Draw(void) float bgOutlineEffectRightMargin = 0.0f; bool isCustomBitmap = false; + FloatDimension minSize(0.0f, 0.0f); + FloatRectangle pBounds; + _ControlOrientation orientation; orientation = __pPopup->GetOrientation(); @@ -311,6 +315,7 @@ _PopupPresenter::Draw(void) GET_SHAPE_CONFIG(POPUP::BG_OUTLINE_EFFECT_BOTTOM_MARGIN, orientation, bgOutlineEffectBottomMargin); GET_SHAPE_CONFIG(POPUP::BG_OUTLINE_EFFECT_LEFT_MARGIN, orientation, bgOutlineEffectLeftMargin); GET_SHAPE_CONFIG(POPUP::BG_OUTLINE_EFFECT_RIGHT_MARGIN, orientation, bgOutlineEffectRightMargin); + GET_DIMENSION_CONFIG(POPUP::MIN_SIZE_EXCEPT_TRANSPARENT_MARGIN, orientation, minSize); // Get canvas Canvas* pCanvas = __pPopup->GetCanvasN(); @@ -325,13 +330,14 @@ _PopupPresenter::Draw(void) pBackgroundCanvas->SetBackgroundColor(Color(0, 0, 0, 0)); pBackgroundCanvas->Clear(); + pBounds = __pPopup->GetBoundsF(); // Draw BG if (__pPopup->GetBackgroundBitmap() != null) { FloatRectangle bounds(-transLeftMargin, -transTopMargin, - __pPopup->GetBoundsF().width + transLeftMargin + transRightMargin, - __pPopup->GetBoundsF().height + transTopMargin + transBottomMargin); + pBounds.width + transLeftMargin + transRightMargin, + pBounds.height + transTopMargin + transBottomMargin); const Bitmap* pBackgroundBitmap = __pPopup->GetBackgroundBitmap(); if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pBackgroundBitmap)) @@ -362,12 +368,14 @@ _PopupPresenter::Draw(void) } // Draw Outline - if (!isCustomBitmap && __pPopup->GetOutlineBitmap() != null) + if (!isCustomBitmap && __pPopup->GetOutlineBitmap() != null && + _FloatCompareGE(pBounds.width, minSize.width) && + _FloatCompareGE(pBounds.height, minSize.height)) { FloatRectangle bounds(0.0f, 0.0f, - __pPopup->GetBoundsF().width + bgOutlineEffectLeftMargin + bgOutlineEffectRightMargin, - __pPopup->GetBoundsF().height + bgOutlineEffectTopMargin + bgOutlineEffectBottomMargin); + pBounds.width + bgOutlineEffectLeftMargin + bgOutlineEffectRightMargin, + pBounds.height + bgOutlineEffectTopMargin + bgOutlineEffectBottomMargin); const Bitmap* pOutlineBitmap = __pPopup->GetOutlineBitmap(); diff --git a/src/ui/inc/FUi_ResourcePopupConfig.h b/src/ui/inc/FUi_ResourcePopupConfig.h index 3873252..751b343 100644 --- a/src/ui/inc/FUi_ResourcePopupConfig.h +++ b/src/ui/inc/FUi_ResourcePopupConfig.h @@ -32,6 +32,7 @@ DECLARE_UI_CONFIG(POPUP); DECLARE_ANIMATION_CONFIG(PROCESSING_ANIMATION, 1); DECLARE_DIMENSION_CONFIG(MIN_SIZE, 1); DECLARE_DIMENSION_CONFIG(MIN_SIZE_WITH_TITLE, 2); + DECLARE_DIMENSION_CONFIG(MIN_SIZE_EXCEPT_TRANSPARENT_MARGIN, 3); DECLARE_SHAPE_CONFIG(TITLE_HEIGHT, 1); DECLARE_SHAPE_CONFIG(TITLE_TEXT_SIZE, 2); DECLARE_SHAPE_CONFIG(TITLE_TEXT_TOP_MARGIN, 3); diff --git a/src/ui/resource/FUi_ResourcePopupConfig.cpp b/src/ui/resource/FUi_ResourcePopupConfig.cpp index 76cea6c..b7ae6d1 100644 --- a/src/ui/resource/FUi_ResourcePopupConfig.cpp +++ b/src/ui/resource/FUi_ResourcePopupConfig.cpp @@ -78,6 +78,7 @@ START_UI_CONFIG(POPUP); { ADD_DIMENSION_CONFIG(MIN_SIZE, 0, 0); // 20121010 ADD_DIMENSION_CONFIG(MIN_SIZE_WITH_TITLE, 72, 128); // 20130116 + ADD_DIMENSION_CONFIG(MIN_SIZE_EXCEPT_TRANSPARENT_MARGIN, 22, 33); // 20130429 ADD_SHAPE_CONFIG(TITLE_HEIGHT, 78); //20130403 ADD_SHAPE_CONFIG(TITLE_TEXT_SIZE, 50); //20121113 -- 2.7.4