From 78923881bedaec90f542c94cc2e524389fdc54d8 Mon Sep 17 00:00:00 2001 From: Keuckdo Bang Date: Fri, 22 Mar 2013 13:46:31 +0900 Subject: [PATCH] When update layout, logic calculating clientbounds of form was fixed. Change-Id: Id7fb138d876f1337da386c03612571fdc860aa51 --- src/ui/controls/FUiCtrl_Form.cpp | 73 ++++++++++++++++++++++++++++++++++++++++ src/ui/inc/FUiCtrl_Form.h | 1 + 2 files changed, 74 insertions(+) diff --git a/src/ui/controls/FUiCtrl_Form.cpp b/src/ui/controls/FUiCtrl_Form.cpp index ac9d0e6..c787553 100644 --- a/src/ui/controls/FUiCtrl_Form.cpp +++ b/src/ui/controls/FUiCtrl_Form.cpp @@ -2687,5 +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 diff --git a/src/ui/inc/FUiCtrl_Form.h b/src/ui/inc/FUiCtrl_Form.h index a8efdb4..ffef5a0 100644 --- a/src/ui/inc/FUiCtrl_Form.h +++ b/src/ui/inc/FUiCtrl_Form.h @@ -198,6 +198,7 @@ public: virtual void OnActionPerformed(const Tizen::Ui::_Control& source, int actionId); virtual void OnChildVisibleStateChanged(const _Control& child); virtual void OnBoundsChanged(void); + virtual void UpdateClientBounds(const Tizen::Graphics::FloatDimension& size); // Focus UI Tizen::Base::Collection::IListT<_Control*>* GetFocusList(void) const; -- 2.7.4