Add API for calculating clientbounds.
authorKeuckdo Bang <keuckdo.bang@samsung.net>
Wed, 20 Mar 2013 05:08:22 +0000 (14:08 +0900)
committerKeuckdo Bang <keuckdo.bang@samsung.net>
Wed, 20 Mar 2013 05:08:22 +0000 (14:08 +0900)
Change-Id: If28361b43fe5ad16ffcb3a516d0835c815991b31

src/ui/controls/FUiCtrl_Form.cpp
src/ui/inc/FUiCtrl_Form.h

index 25977b2..c787553 100644 (file)
@@ -2512,16 +2512,9 @@ _Form::AdjustClientBounds(void)
                }
        }
 
-       if (clientBounds.height < 0.0f)
-       {
-               SysLog(NID_UI_CTRL, "[E_SYSTEM] The Client bounds is not valid. : client height(%d), indicator height(%d), header height(%d), footer height(%d)",
-                               clientBounds.height, indicatorBounds.height, GetToolbarHeight(true), GetToolbarHeight(false));
-       }
-
        SetClientBounds(clientBounds);
 
        return r;
-
 }
 
 void
@@ -2694,4 +2687,78 @@ _Form::GetFocusList(void) const
        return __pFocusControlList.get();
 }
 
+void
+_Form::UpdateClientBounds(const FloatDimension& size)
+{
+       FloatRectangle clientBounds(0.0f, 0.0f, size.width, size.height);
+
+       if (__deflated)
+       {
+               clientBounds.height -= __deflatedHeight;
+       }
+
+       FloatRectangle indicatorBounds = GetIndicatorBoundsF();
+
+       _Control* pParent = GetParent();
+       _Frame* pFrame = dynamic_cast<_Frame*>(pParent);
+       if (pFrame)
+       {
+               FrameShowMode mode = pFrame->GetShowMode();
+               if (mode == FRAME_SHOW_MODE_FULL_SCREEN)
+               {
+                       if (FORM_STYLE_INDICATOR & __formStyle)
+                       {
+                               if (IsIndicatorVisible() && !IsIndicatorTranslucent())
+                               {
+                                       clientBounds.y += indicatorBounds.height;
+                                       clientBounds.height -= indicatorBounds.height;
+                               }
+                       }
+               }
+       }
+       else
+       {
+               if (FORM_STYLE_INDICATOR & __formStyle)
+               {
+                       if (IsIndicatorVisible() && !IsIndicatorTranslucent())
+                       {
+                               clientBounds.y += indicatorBounds.height;
+                               clientBounds.height -= indicatorBounds.height;
+                       }
+               }
+       }
+
+       if (__pHeader)
+       {
+               if (__pHeader->GetVisibleState() && !IsHeaderTranslucent())
+               {
+                       clientBounds.y += GetToolbarHeightF(true);
+                       clientBounds.height -= GetToolbarHeightF(true);
+               }
+       }
+
+       if (__pTab)
+       {
+               if (__pTab->GetVisibleState()) //&& !IsHeaderTranslucent())
+               {
+                       clientBounds.y += GetTabHeightF();
+                       clientBounds.height -= GetTabHeightF();
+               }
+       }
+
+       if (__pFooter)
+       {
+               if (FORM_STYLE_FOOTER & __formStyle || FORM_STYLE_SOFTKEY_0 & __formStyle || FORM_STYLE_SOFTKEY_1 & __formStyle
+                               || FORM_STYLE_OPTIONKEY & __formStyle)
+               {
+                       if (__pFooter->GetVisibleState() && !IsFooterTranslucent())
+                       {
+                                       clientBounds.height -= GetToolbarHeightF(false);
+                       }
+               }
+       }
+
+       SetClientBounds(clientBounds);
+}
+
 }}} // Tizen::Ui::Controls
index a8efdb4..2395d65 100644 (file)
@@ -193,6 +193,8 @@ public:
        result SetNotificationTrayOpenEnabled(bool enable);
        bool IsNotificationTrayOpenEnabled(void) const;
 
+       void UpdateClientBounds(const Tizen::Graphics::FloatDimension& size);
+
 //callback
        virtual void OnDraw(void);
        virtual void OnActionPerformed(const Tizen::Ui::_Control& source, int actionId);