remove minsize limitations of popup
authorDongJinJeon <dongjin2193.jeon@samsung.com>
Mon, 29 Apr 2013 04:10:08 +0000 (13:10 +0900)
committerDongJinJeon <dongjin2193.jeon@samsung.com>
Mon, 29 Apr 2013 08:35:37 +0000 (17:35 +0900)
Change-Id: I04bd99779d70d866a7d5b0e2cf1511d28a1e89e6
Signed-off-by: DongJinJeon <dongjin2193.jeon@samsung.com>
src/ui/controls/FUiCtrl_PopupImpl.cpp
src/ui/controls/FUiCtrl_PopupPresenter.cpp
src/ui/inc/FUi_ResourcePopupConfig.h
src/ui/resource/FUi_ResourcePopupConfig.cpp

index 77feae1..d321009 100644 (file)
@@ -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;
index e4585e7..416311c 100644 (file)
@@ -29,6 +29,7 @@
 #include <FGrp_TextTextSimple.h>
 #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();
 
index 3873252..751b343 100644 (file)
@@ -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);
index 76cea6c..b7ae6d1 100644 (file)
@@ -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