From: DongJinJeon Date: Wed, 3 Apr 2013 07:36:57 +0000 (+0900) Subject: Modified Popup Clientarea X-Git-Tag: accepted/tizen_2.1/20130425.033138~495^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=77ba0d5b5e9bef4eb43ae5a4b1d81521a64a0a99;p=platform%2Fframework%2Fnative%2Fuifw.git Modified Popup Clientarea Change-Id: Ie57bb21b219d61960d6857aa44f6da8b88fa92c5 Signed-off-by: DongJinJeon --- diff --git a/src/ui/controls/FUiCtrl_Popup.cpp b/src/ui/controls/FUiCtrl_Popup.cpp index 5909c2d..a5f0be0 100644 --- a/src/ui/controls/FUiCtrl_Popup.cpp +++ b/src/ui/controls/FUiCtrl_Popup.cpp @@ -350,36 +350,14 @@ _Popup::GetPopupClientArea(void) const float height = 0.0f; float titleHeight = 0.0f; - float titleLetfMargin = 0.0f; - float titleRightMargin = 0.0f; - float transTopMargin = 0.0f; - float transBottomMargin = 0.0f; - float transLeftMargin = 0.0f; - float transRightMargin = 0.0f; - - _ControlOrientation orientation; - - orientation = GetOrientation(); - - GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, orientation, titleHeight); - GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_LEFT_MARGIN, orientation, titleLetfMargin); - GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_RIGHT_MARGIN, orientation, titleRightMargin); - - 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::BG_IMAGE_TRANSPARENT_LEFT_MARGIN, orientation, transLeftMargin); - GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_RIGHT_MARGIN, orientation, transRightMargin); - - x = titleLetfMargin; - width = GetBoundsF().width - (titleLetfMargin + titleRightMargin); - - if (HasTitle() == false) + if (HasTitle()) { - titleHeight = 0.0f; + GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, GetOrientation(), titleHeight); + y = titleHeight; } - y = titleHeight; + width = GetBoundsF().width; height = GetBoundsF().height - y; return FloatRectangle(x, y, width, height); @@ -545,13 +523,6 @@ _Popup::InitializeAccessibilityElement(void) _pTitleTextAccessibilityElement->SetTrait(L"Popup Title"); pContainer->AddElement(*_pTitleTextAccessibilityElement); - - _Label* pLabelCore = __pPopupPresenter->GetSystemLabel(); - _AccessibilityContainer* pLabelContainer = pLabelCore->GetAccessibilityContainer(); - if (pLabelContainer != null) - { - pLabelContainer->Activate(false); - } } return; @@ -647,30 +618,16 @@ _Popup::OnOwnerChanged(_Control* pOldOwner) void _Popup::UpdateClientBounds(const FloatDimension& size, FloatRectangle& clientBounds) { - float y = 0.0f; - float titleHeight = 0.0f; - float titleLetfMargin = 0.0f; - float titleRightMargin = 0.0f; - - _ControlOrientation orientation; - - orientation = GetOrientation(); - - GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, orientation, titleHeight); - GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_LEFT_MARGIN, orientation, titleLetfMargin); - GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_RIGHT_MARGIN, orientation, titleRightMargin); if (HasTitle()) { - y = titleHeight; + GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, GetOrientation(), titleHeight); + clientBounds.y = titleHeight; } - clientBounds.x = titleLetfMargin; - clientBounds.y = y; - - clientBounds.width = size.width - (titleLetfMargin + titleRightMargin); - clientBounds.height = size.height - y; + clientBounds.width = size.width; + clientBounds.height = size.height - clientBounds.y; } }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrl_PopupPresenter.cpp b/src/ui/controls/FUiCtrl_PopupPresenter.cpp index 465f5b2..0d8386c 100755 --- a/src/ui/controls/FUiCtrl_PopupPresenter.cpp +++ b/src/ui/controls/FUiCtrl_PopupPresenter.cpp @@ -33,7 +33,6 @@ #include "FUi_ResourceManager.h" #include "FUi_UiTouchEvent.h" #include "FUiAnim_RootVisualElement.h" -#include "FUiCtrl_Label.h" #include "FUiCtrl_PopupPresenter.h" #include "FUiCtrl_Popup.h" @@ -55,7 +54,6 @@ _PopupPresenter::_PopupPresenter(void) , __pPopupVE(null) , __pBackgroundVE(null) , __pTextObject(null) - , __pLabelCore(null) , __titleBounds(0.0f, 0.0f, 0.0f, 0.0f) { //empty statement @@ -69,9 +67,6 @@ _PopupPresenter::~_PopupPresenter(void) __pTextObject = null; } - delete __pLabelCore; - __pLabelCore = null; - if (__pBackgroundVE != null) { __pBackgroundVE->Destroy(); @@ -112,17 +107,6 @@ _PopupPresenter::Initialize(_Popup& popup) GET_SHAPE_CONFIG(POPUP::BG_OUTLINE_EFFECT_LEFT_MARGIN, orientation, bgOutlineEffectLeftMargin); GET_SHAPE_CONFIG(POPUP::BG_OUTLINE_EFFECT_RIGHT_MARGIN, orientation, bgOutlineEffectRightMargin); - // system label to cover non-client area - __pLabelCore = _Label::CreateLabelN(); - r = GetLastResult(); - SysTryReturnVoidResult(NID_UI_CTRL, __pLabelCore != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - - __pLabelCore->SetBackgroundColor(Color(0, 0 ,0, 0)); - - r = __pPopup->AttachSystemChild(*__pLabelCore); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - __pBackgroundVE = new (std::nothrow) _VisualElement(); SysTryReturnVoidResult(NID_UI_CTRL, __pBackgroundVE != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); @@ -152,9 +136,6 @@ _PopupPresenter::Initialize(_Popup& popup) return; CATCH: - delete __pLabelCore; - __pLabelCore = null; - __pBackgroundVE->Destroy(); __pBackgroundVE = null; @@ -162,12 +143,6 @@ CATCH: } -_Label* -_PopupPresenter::GetSystemLabel(void) const -{ - return __pLabelCore; -} - void _PopupPresenter::OnFontChanged(Font* pFont) { @@ -267,7 +242,6 @@ CATCH: void _PopupPresenter::OnDraw(void) { - DrawSystemLabel(); Draw(); } @@ -278,54 +252,6 @@ _PopupPresenter::GetTitleTextBounds(void) const } void -_PopupPresenter::DrawSystemLabel(void) -{ - result r = E_SUCCESS; - - float titleHeight = 0.0f; - float transTopMargin = 0.0f; - float transBottomMargin = 0.0f; - - _ControlOrientation orientation; - - orientation = __pPopup->GetOrientation(); - - GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, orientation, titleHeight); - GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_TOP_MARGIN, orientation, transTopMargin); - GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_BOTTOM_MARGIN, orientation, transBottomMargin); - - FloatRectangle systemBounds; - FloatRectangle clientBounds = __pPopup->GetPopupClientArea(); - FloatRectangle bounds = __pPopup->GetBoundsF(); - - systemBounds.x = clientBounds.x + clientBounds.width; - - if (__pPopup->HasTitle() == false) - { - titleHeight = 0.0f; - } - systemBounds.y = clientBounds.y + POPUP_LABEL_GAP; - - systemBounds.width = (bounds.width - systemBounds.x) - POPUP_LABEL_GAP / 2.0f; - systemBounds.height = clientBounds.height -POPUP_LABEL_GAP * 2.0f; - - r = __pLabelCore->SetBounds(systemBounds); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - - __pLabelCore->SetBackgroundColor(__pPopup->GetColor()); - - __pLabelCore->Draw(); - - return; - -CATCH: - delete __pLabelCore; - __pLabelCore = null; - - return; -} - -void _PopupPresenter::UpdateEffectBounds(void) { FloatRectangle bounds; diff --git a/src/ui/inc/FUiCtrl_PopupPresenter.h b/src/ui/inc/FUiCtrl_PopupPresenter.h index 61314ef..d0e535d 100644 --- a/src/ui/inc/FUiCtrl_PopupPresenter.h +++ b/src/ui/inc/FUiCtrl_PopupPresenter.h @@ -28,7 +28,6 @@ #include #include -#include "FUiCtrl_Label.h" #include "FUiCtrl_Popup.h" namespace Tizen { namespace Ui { namespace Controls @@ -66,8 +65,6 @@ public: result SetTitleTextObject(const Tizen::Base::String& title); - Tizen::Ui::Controls::_Label* GetSystemLabel(void) const; - Tizen::Graphics::FloatRectangle GetTitleTextBounds(void) const; void UpdateEffectBounds(void); @@ -88,8 +85,6 @@ private: _PopupPresenter(const _PopupPresenter& rhs); _PopupPresenter& operator =(const _PopupPresenter& rhs); - void DrawSystemLabel(void); - //Attribute protected: Tizen::Graphics::Font* _pFont; @@ -101,10 +96,8 @@ private: Tizen::Ui::Animations::_VisualElement* __pBackgroundVE; Tizen::Graphics::_Text::TextObject* __pTextObject; - Tizen::Ui::Controls::_Label* __pLabelCore; Tizen::Graphics::FloatRectangle __titleBounds; - static const int POPUP_LABEL_GAP = 8.0f; }; // _PopupPresenter