add animation top margin of ProgressPopup
authorInKyuPark <ingyou.park@samsung.com>
Tue, 30 Apr 2013 06:02:07 +0000 (15:02 +0900)
committerDongJinJeon <dongjin2193.jeon@samsung.com>
Tue, 30 Apr 2013 06:06:47 +0000 (15:06 +0900)
Change-Id: Ifaeb79e33b6e6bcc7e1efe1cfd44e9981ffd2487
Signed-off-by: InKyuPark <ingyou.park@samsung.com>
src/ui/controls/FUiCtrl_ProgressPopup.cpp
src/ui/controls/FUiCtrl_ProgressPopupImpl.cpp
src/ui/controls/FUiCtrl_ProgressPopupPresenter.cpp
src/ui/inc/FUi_ResourcePopupConfig.h
src/ui/resource/FUi_ResourcePopupConfig.cpp

index e3c87a0..983b272 100644 (file)
@@ -339,7 +339,7 @@ _ProgressPopup::GetTotalHeight(void) const
        float transTopMargin = 0.0f;
        float transBottomMargin = 0.0f;
        float titleHeight = 0.0f;
-       float noTitleHeigth = 0.0f;
+       float animationTopMargin = 0.0f;
        float animationWidth = 0.0f;
        float textTopGap = 0.0f;
        float textBottomGap = 0.0f;
@@ -352,11 +352,9 @@ _ProgressPopup::GetTotalHeight(void) const
 
        GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_TOP_MARGIN, orientation, transTopMargin);
        GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_BOTTOM_MARGIN, orientation, transBottomMargin);
-       GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_NO_TITLE_TOP_MARGIN, orientation, noTitleHeigth);
        GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_WIDTH, orientation, animationWidth);
        GET_SHAPE_CONFIG(POPUP::PROCESS_TEXT_TOP_MARGIN, orientation, textTopGap);
        GET_SHAPE_CONFIG(POPUP::PROCESS_TEXT_BOTTOM_MARGIN, orientation, textBottomGap);
-       GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, orientation, titleHeight);
 
        GET_SHAPE_CONFIG(MESSAGEBOX::BOTTOM_HEIGHT, orientation, bottomHeight);
        GET_SHAPE_CONFIG(MESSAGEBOX::MIN_HEIGHT, orientation, minHeight);
@@ -364,11 +362,12 @@ _ProgressPopup::GetTotalHeight(void) const
 
        if (HasTitle())
        {
-               noTitleHeigth = 0.0f;
+               GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, orientation, titleHeight);
+               GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_WITH_TITLE_TOP_MARGIN, orientation, animationTopMargin);
        }
        else
        {
-               titleHeight = 0.0f;
+               GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_NO_TITLE_TOP_MARGIN, orientation, animationTopMargin);
        }
 
        if (!HasText())
@@ -384,7 +383,7 @@ _ProgressPopup::GetTotalHeight(void) const
 
 
        float totalH = titleHeight
-                       + noTitleHeigth
+                       + animationTopMargin
                        + animationWidth
                        + textTopGap
                        + textBottomGap
@@ -424,7 +423,7 @@ _ProgressPopup::GetAnimationRect(void) const
        float defaultWidth = 0.0f;
        float titleHeight = 0.0f;
        float animationWidth = 0.0f;
-       float noTitleProcessTop = 0.0f;
+       float animationTopMargin = 0.0f;
        float transTopMargin = 0.0f;
 
        _ControlOrientation orientation;
@@ -433,24 +432,27 @@ _ProgressPopup::GetAnimationRect(void) const
 
        GET_SHAPE_CONFIG(MESSAGEBOX::DEFAULT_WIDTH, orientation, defaultWidth);
 
-       GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, orientation, titleHeight);
        GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_WIDTH, orientation, animationWidth);
-       GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_NO_TITLE_TOP_MARGIN, orientation, noTitleProcessTop);
        GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_TOP_MARGIN, orientation, transTopMargin);
 
        if (HasTitle())
        {
-               animationBounds = FloatRectangle((defaultWidth - animationWidth) / 2.0f, titleHeight + transTopMargin, animationWidth, animationWidth);
+               GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, orientation, titleHeight);
+               GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_WITH_TITLE_TOP_MARGIN, orientation, animationTopMargin);
        }
        else if (HasText() || HasButton())
        {
-               animationBounds = FloatRectangle((defaultWidth - animationWidth) / 2.0f, noTitleProcessTop + transTopMargin, animationWidth, animationWidth);
+               GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_NO_TITLE_TOP_MARGIN, orientation, animationTopMargin);
        }
        else
        {
-               animationBounds = FloatRectangle((GetBoundsF().width - animationWidth) / 2.0f, noTitleProcessTop + transTopMargin, animationWidth, animationWidth);
+               GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_NO_TITLE_TOP_MARGIN, orientation, animationTopMargin);
        }
 
+       animationBounds = FloatRectangle((defaultWidth - animationWidth) / 2.0f,
+                                                                       titleHeight + animationTopMargin + transTopMargin,
+                                                                       animationWidth, animationWidth);
+
        return animationBounds;
 }
 
index 406b672..cd08671 100644 (file)
@@ -390,27 +390,24 @@ _ProgressPopupImpl::OnChangeLayout(_ControlOrientation orientation)
                r = GetLastResult();
                SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
 
-               if(GetCore().HasTitle() || GetCore().HasText() || GetCore().HasButton())
-               {
-                       float maxHeight = 0.0f;
-                       float defaultWidth = 0.0f;
+               float maxHeight = 0.0f;
+               float defaultWidth = 0.0f;
 
-                       GET_SHAPE_CONFIG(MESSAGEBOX::MAX_HEIGHT, orientation, maxHeight);
-                       GET_SHAPE_CONFIG(MESSAGEBOX::DEFAULT_WIDTH, orientation, defaultWidth);
+               GET_SHAPE_CONFIG(MESSAGEBOX::MAX_HEIGHT, orientation, maxHeight);
+               GET_SHAPE_CONFIG(MESSAGEBOX::DEFAULT_WIDTH, orientation, defaultWidth);
 
-                       bounds.width = defaultWidth;
+               bounds.width = defaultWidth;
 
-                       float totalH = -1.0f;
-                       totalH = GetCore().GetTotalHeight();
+               float totalH = -1.0f;
+               totalH = GetCore().GetTotalHeight();
 
-                       if (totalH > maxHeight)
-                       {
-                               bounds.height = maxHeight;
-                       }
-                       else
-                       {
-                               bounds.height = totalH;
-                       }
+               if (totalH > maxHeight)
+               {
+                       bounds.height = maxHeight;
+               }
+               else
+               {
+                       bounds.height = totalH;
                }
        }
 
index 1a6cd5b..cb5c223 100644 (file)
@@ -217,14 +217,12 @@ _ProgressPopupPresenter::SetTextObject(void)
        float animationWidth = 0.0f;
        float textTopMargin = 0.0f;
        float textBottomMargin = 0.0f;
-       float noTitleHeight = 0.0f;
+       float animationTopMargin = 0.0f;
 
        _ControlOrientation orientation;
 
        orientation = __pProgressPopup->GetOrientation();
 
-       GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, orientation, titleHeight);
-       GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_NO_TITLE_TOP_MARGIN, orientation, noTitleHeight);
        GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_WIDTH, orientation, animationWidth);
 
        GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_TOP_MARGIN, orientation, transTopMargin);
@@ -245,11 +243,12 @@ _ProgressPopupPresenter::SetTextObject(void)
 
        if (__pProgressPopup->HasTitle())
        {
-               noTitleHeight = 0.0f;
+               GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, orientation, titleHeight);
+               GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_WITH_TITLE_TOP_MARGIN, orientation, animationTopMargin);
        }
        else
        {
-               titleHeight = 0.0f;
+               GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_NO_TITLE_TOP_MARGIN, orientation, animationTopMargin);
        }
 
        if (__pProgressPopup->HasText())
@@ -286,7 +285,7 @@ _ProgressPopupPresenter::SetTextObject(void)
 
                // Calculate Text bounds
                __textBounds.SetBounds(textLeftMargin + transLeftMargin,
-                                                               titleHeight + textTopMargin + transTopMargin + animationWidth + noTitleHeight,
+                                                               titleHeight + textTopMargin + transTopMargin + animationWidth + animationTopMargin,
                                                                defaultWidth - (textLeftMargin + textRightMargin + transLeftMargin + transRightMargin),
                                                                maxHeight - titleHeight - bottomHeight - animationWidth);
 
@@ -427,7 +426,7 @@ _ProgressPopupPresenter::SetProcessAnimation(void)
                        __pAnimation->GetVisualElement()->SetOpacity(0.6f);
                        __pAnimation->SetBounds(FloatRectangle(0.0f, 0.0f, animationBounds.width, animationBounds.height));
                }
-               else //(__pProgressPopup->HasTitle() || __pProgressPopup->HasText() || __pProgressPopup->HasButton())
+               else
                {
                        __pAnimation->SetBounds(FloatRectangle(animationBounds.x, animationBounds.y, animationBounds.width, animationBounds.height));
                }
@@ -542,7 +541,7 @@ _ProgressPopupPresenter::Draw(void)
        if (__pTitleTextObject != null)
        {
                r = SetFontInfo(FONT_STYLE_PLAIN, titleTextSize);
-               SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Failed to set font.", GetErrorMessage(r));
+               SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
 
                __pTitleTextObject->SetFont(_pFont, 0, __pTitleTextObject->GetTextLength());
                __pTitleTextObject->SetBounds(__titleBounds);
@@ -554,6 +553,10 @@ _ProgressPopupPresenter::Draw(void)
                __pLabel->SetTextColor(__pProgressPopup->GetTextColor());
        }
 
+       //fall thtrough
+CATCH:
+       delete pCanvas;
+
        return;
 }
 
@@ -609,7 +612,7 @@ _ProgressPopupPresenter::GetButtonBounds(void) const
        float btnTopMargin = 0.0f;
        float transTopMargin = 0.0f;
        float animationWidth = 0.0f;
-       float noTitleHeight = 0.0f;
+       float animationTopMargin = 0.0f;
        float textTopMargin = 0.0f;
        float textBottomMargin = 0.0f;
 
@@ -617,10 +620,8 @@ _ProgressPopupPresenter::GetButtonBounds(void) const
 
        orientation = __pProgressPopup->GetOrientation();
 
-       GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, orientation, titleHeight);
        GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_TOP_MARGIN, orientation, transTopMargin);
        GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_WIDTH, orientation, animationWidth);
-       GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_NO_TITLE_TOP_MARGIN, orientation, noTitleHeight);
        GET_SHAPE_CONFIG(POPUP::PROCESS_TEXT_TOP_MARGIN, orientation, textTopMargin);
        GET_SHAPE_CONFIG(POPUP::PROCESS_TEXT_BOTTOM_MARGIN, orientation, textBottomMargin);
 
@@ -636,17 +637,18 @@ _ProgressPopupPresenter::GetButtonBounds(void) const
 
        if (__pProgressPopup->HasTitle())
        {
-               noTitleHeight = 0.0f;
+               GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, orientation, titleHeight);
+               GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_WITH_TITLE_TOP_MARGIN, orientation, animationTopMargin);
        }
        else
        {
-               titleHeight = 0.0f;
+               GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_NO_TITLE_TOP_MARGIN, orientation, animationTopMargin);
        }
 
        if (!__pProgressPopup->HasText())
        {
                textTopMargin = 0.0f;
-               textBottomMargin = 0.0f;
+               textBottomMargin = textBottomMargin * 1.5f;
        }
 
        width = defaultWidth - (btnSideMargin1 * 2.0f);
@@ -655,7 +657,7 @@ _ProgressPopupPresenter::GetButtonBounds(void) const
 
        y = transTopMargin
                + titleHeight
-               + noTitleHeight
+               + animationTopMargin
                + animationWidth
                + textTopMargin
                + textBottomMargin
@@ -694,12 +696,9 @@ _ProgressPopupPresenter::OnChangeLayout(_ControlOrientation orientation)
 {
        FloatRectangle animationBounds = __pProgressPopup->GetAnimationRect();
 
-       if (__pProgressPopup->HasTitle() || __pProgressPopup->HasText() || __pProgressPopup->HasButton())
+       if (__pAnimation != null)
        {
-               if (__pAnimation != null)
-               {
-                       __pAnimation->SetBounds(FloatRectangle(animationBounds.x, animationBounds.y, animationBounds.width, animationBounds.height));
-               }
+               __pAnimation->SetBounds(FloatRectangle(animationBounds.x, animationBounds.y, animationBounds.width, animationBounds.height));
        }
 
        if (__pProgressPopup->HasTitle())
index 751b343..afc7356 100644 (file)
@@ -55,5 +55,6 @@ DECLARE_UI_CONFIG(POPUP);
        DECLARE_SHAPE_CONFIG(BG_OUTLINE_EFFECT_LEFT_MARGIN, 20);
        DECLARE_SHAPE_CONFIG(BG_OUTLINE_EFFECT_RIGHT_MARGIN, 21);
        DECLARE_SHAPE_CONFIG(BODY_TEXT_HEIGHT, 22);
+       DECLARE_SHAPE_CONFIG(PROCESS_ANIMATION_WITH_TITLE_TOP_MARGIN, 23);
 DECLARE_END_UI_CONFIG(POPUP);
 #endif //_FUI_RESOURCE_POPUP_CONFIG_H_
index b7ae6d1..51d7ac3 100644 (file)
@@ -99,6 +99,7 @@ START_UI_CONFIG(POPUP);
 
                ADD_SHAPE_CONFIG(PROCESS_ANIMATION_WIDTH, 63);                              //20130403
                ADD_SHAPE_CONFIG(PROCESS_ANIMATION_NO_TITLE_TOP_MARGIN, 34);            //20130403
+               ADD_SHAPE_CONFIG(PROCESS_ANIMATION_WITH_TITLE_TOP_MARGIN, 9);           //20130403
 
                ADD_SHAPE_CONFIG(PROCESS_TEXT_TOP_MARGIN, 9);                       //20130403
                ADD_SHAPE_CONFIG(PROCESS_TEXT_BOTTOM_MARGIN, 20);                       //20121113
@@ -109,40 +110,5 @@ START_UI_CONFIG(POPUP);
                ADD_SHAPE_CONFIG(BG_OUTLINE_EFFECT_RIGHT_MARGIN, 16);   //20130122
        }
        END_UI_CONFIG_MODE(720x1280);
-
-       START_UI_CONFIG_MODE(1280x720);
-       {
-               ADD_DIMENSION_CONFIG(MIN_SIZE, 0, 0);
-               ADD_DIMENSION_CONFIG(MIN_SIZE_WITH_TITLE, 72, 128);         // 20130116
-
-               ADD_SHAPE_CONFIG(TITLE_HEIGHT, 78);                             //20130403
-               ADD_SHAPE_CONFIG(TITLE_TEXT_SIZE, 50);
-               ADD_SHAPE_CONFIG(TITLE_TEXT_TOP_MARGIN, 20);    //20130403
-               ADD_SHAPE_CONFIG(TITLE_TEXT_LEFT_MARGIN, 29);   //20130403
-               ADD_SHAPE_CONFIG(TITLE_TEXT_RIGHT_MARGIN, 29);  //20130403
-
-               ADD_SHAPE_CONFIG(TOP_BORDER, 6);
-               ADD_SHAPE_CONFIG(BOTTOM_BORDER, 30);
-               ADD_SHAPE_CONFIG(SIDE_BORDER, 12);
-
-               ADD_SHAPE_CONFIG(BG_IMAGE_TRANSPARENT_TOP_MARGIN, 14);
-               ADD_SHAPE_CONFIG(BG_IMAGE_TRANSPARENT_BOTTOM_MARGIN, 34);
-               ADD_SHAPE_CONFIG(BG_IMAGE_TRANSPARENT_LEFT_MARGIN, 16);
-               ADD_SHAPE_CONFIG(BG_IMAGE_TRANSPARENT_RIGHT_MARGIN, 16);
-               ADD_SHAPE_CONFIG(OUTLINE_BORDER, 3);
-
-               ADD_SHAPE_CONFIG(PROCESS_ANIMATION_WIDTH, 63);                                  //20130403
-               ADD_SHAPE_CONFIG(PROCESS_ANIMATION_NO_TITLE_TOP_MARGIN, 34);    //20130403
-
-               ADD_SHAPE_CONFIG(PROCESS_TEXT_TOP_MARGIN, 9);           //20130403
-               ADD_SHAPE_CONFIG(PROCESS_TEXT_BOTTOM_MARGIN, 20);
-
-               ADD_SHAPE_CONFIG(BG_OUTLINE_EFFECT_TOP_MARGIN, 14);             //20130122
-               ADD_SHAPE_CONFIG(BG_OUTLINE_EFFECT_BOTTOM_MARGIN, 34);  //20130122
-               ADD_SHAPE_CONFIG(BG_OUTLINE_EFFECT_LEFT_MARGIN, 16);    //20130122
-               ADD_SHAPE_CONFIG(BG_OUTLINE_EFFECT_RIGHT_MARGIN, 16);   //20130122
-       }
-       END_UI_CONFIG_MODE(1280x720);
-
 }
 END_UI_CONFIG(POPUP);