From: kishorekumar Dachinamoorthy Date: Wed, 29 May 2013 07:17:52 +0000 (+0530) Subject: Fixing JIRA issue N_Se-39320. X-Git-Tag: accepted/tizen/20130924.144426~1^2~680^2~62^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8912db3bcc8d15b8188b6a10e88bd2f4c78199ad;p=platform%2Fframework%2Fnative%2Fuifw.git Fixing JIRA issue N_Se-39320. Change-Id: Ic814db9482069c130c3c46285e938ef21d583631 Signed-off-by: kishorekumar Dachinamoorthy --- diff --git a/src/ui/controls/FUiCtrl_SliderOverlay.cpp b/src/ui/controls/FUiCtrl_SliderOverlay.cpp index bf1de74..7bb7e02 100644 --- a/src/ui/controls/FUiCtrl_SliderOverlay.cpp +++ b/src/ui/controls/FUiCtrl_SliderOverlay.cpp @@ -24,8 +24,11 @@ #include #include #include "FUiAnim_VisualElement.h" -#include "FUiCtrl_SliderOverlay.h" #include "FUi_ResourceManager.h" +#include "FUi_EcoreEvasMgr.h" +#include "FUi_EcoreEvas.h" +#include "FUiCtrl_SliderOverlay.h" + using namespace Tizen::Graphics; @@ -39,6 +42,7 @@ _SliderOverlay::_SliderOverlay(void) , __overlayTextColor(0) , __pFont(null) , __pOwner(null) + , __overlayWidth(-1.0f) { Tizen::Ui::Animations::_VisualElement* pBase = GetVisualElement(); @@ -97,6 +101,7 @@ void _SliderOverlay::SetFont(Tizen::Graphics::Font* pFont) { __pFont = pFont; + __overlayWidth = -1.0f; return; } @@ -176,6 +181,16 @@ _SliderOverlay::DrawSliderOverlay(int positionX, int handleWidth, int value) SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); (_FontImpl::GetInstance(*__pFont))->SetSize(overlayTextSize); + + if (__overlayWidth == -1.0f) + { + int fixedValue = 999; + Tizen::Base::String fixedText; + fixedText.Append(fixedValue); + __pFont->GetTextExtent(fixedText, fixedText.GetLength(), textDim); + __overlayWidth = textDim.width + 2 * overlayLeftMargin; + } + __pFont->GetTextExtent(text, text.GetLength(), textDim); if (text.GetLength() == SLIDER_OVERLAY_SINGLE_DIGIT) @@ -255,6 +270,20 @@ CATCH: return E_SYSTEM; } +result +_SliderOverlay::OnBoundsChanging(const FloatRectangle& bounds) +{ + _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas(); + SysTryReturn(NID_UI, pEcoreEvas, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred."); + + FloatRectangle newBounds( bounds.x, bounds.y , __overlayWidth, bounds.height); + + pEcoreEvas->SetWindowBounds(*GetRootWindow(), newBounds); + result r = GetLastResult(); + SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage); + return r; +} + bool _SliderOverlay::IsActivatedOnOpen(void) const { diff --git a/src/ui/inc/FUiCtrl_SliderOverlay.h b/src/ui/inc/FUiCtrl_SliderOverlay.h index 80400ec..c74c9c4 100644 --- a/src/ui/inc/FUiCtrl_SliderOverlay.h +++ b/src/ui/inc/FUiCtrl_SliderOverlay.h @@ -46,6 +46,7 @@ public: void SetFont(Tizen::Graphics::Font* pFont); result DrawSliderOverlay(int positionX,int handleWidth, int value); + virtual result OnBoundsChanging(const Tizen::Graphics::FloatRectangle& bounds); virtual bool IsActivatedOnOpen(void) const; virtual result OnAttachedToMainTree(void); virtual result OnDetachingFromMainTree(void); @@ -71,6 +72,7 @@ private: Tizen::Graphics::Font* __pFont; _Control* __pOwner; + float __overlayWidth; }; // _SliderOverlay