Diplay name fixed
authorHeeJu Kang <mobum.kang@samsung.com>
Thu, 17 Jan 2013 09:24:47 +0000 (18:24 +0900)
committerHeeJu Kang <mobum.kang@samsung.com>
Thu, 17 Jan 2013 09:24:47 +0000 (18:24 +0900)
Change-Id: I8a70cba4a51b4dfe98b4aa79a945f9ac6c45b49f
Signed-off-by: HeeJu Kang <mobum.kang@samsung.com>
src/FShell_LiveboxViewPresenter.cpp
src/FShell_LiveboxViewPresenter.h

index ba16aa0..7604bea 100644 (file)
@@ -43,6 +43,7 @@ namespace Tizen { namespace Shell
 _LiveboxViewPresenter::_LiveboxViewPresenter(const _LiveboxView& liveBoxView)
        : __pLiveboxView(const_cast <_LiveboxView*>(&liveBoxView))
        , __pLiveboxViewModel(new (std::nothrow) _LiveboxViewModel())
+       , __pSimpleText(null)
 {
        SysTryReturnVoidResult(NID_UI_CTRL, __pLiveboxViewModel, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
 }
@@ -55,14 +56,14 @@ _LiveboxViewPresenter::~_LiveboxViewPresenter(void)
 result
 _LiveboxViewPresenter::Initialize(const AppId& appId, const Tizen::Base::String& providerName)
 {
-       const int FONT_SIZE = 10;
+       const int FONT_SIZE = 20;
 
        __pLiveboxViewModel->Initialize(appId, providerName);
 
        unique_ptr<Font> pFont(new (std::nothrow) Font());
        SysTryReturn(NID_UI_CTRL, pFont, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
 
-       result r = pFont->Construct(FONT_STYLE_PLAIN, FONT_SIZE);
+       result r = pFont->Construct(FONT_STYLE_BOLD, FONT_SIZE);
        SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
        std::unique_ptr<TextObject> pTextObject(new (std::nothrow) TextObject());
@@ -158,18 +159,23 @@ _LiveboxViewPresenter::Draw(void)
 void
 _LiveboxViewPresenter::DrawText(Canvas& canvas)
 {
-       const int TEXT_OBJECT_HEIGHT = 20;
-
+       const int TEXT_OBJECT_HEIGHT = 25;
+       result r = E_SUCCESS;
        String appName(GetDisplayName());
 
-       unique_ptr<TextSimple> pSimpleText(new (std::nothrow) TextSimple(appName.GetPointer(), appName.GetLength()));
-       SysTryReturnVoidResult(NID_UI_CTRL, pSimpleText, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
+       if (!__pSimpleText)
+       {
+               unique_ptr<TextSimple> pSimpleText(new (std::nothrow) TextSimple(appName.GetPointer(), appName.GetLength()));
+               SysTryReturnVoidResult(NID_UI_CTRL, pSimpleText, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
 
-       result r = __pTextObject->AppendElement(*pSimpleText);
-       SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+               r = __pTextObject->AppendElement(*pSimpleText);
+               SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
 
-       Rectangle liveboxBounds(__pLiveboxView->GetBounds());
+               __pSimpleText = pSimpleText.release();
+       }
 
+       Rectangle liveboxBounds(__pLiveboxView->GetBounds());
+       
        __pTextObject->SetBounds(Rectangle(0, liveboxBounds.height - TEXT_OBJECT_HEIGHT, liveboxBounds.width, TEXT_OBJECT_HEIGHT));
        __pTextObject->SetAlignment(TEXT_OBJECT_ALIGNMENT_CENTER | TEXT_OBJECT_ALIGNMENT_MIDDLE);
        __pTextObject->SetFont(__pFont.get(), 0, __pTextObject->GetTextLength());
@@ -179,8 +185,6 @@ _LiveboxViewPresenter::DrawText(Canvas& canvas)
 
        r = __pTextObject->Draw(*_CanvasImpl::GetInstance(canvas));
        SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
-
-       pSimpleText.release();
 }
 
 }} // Tizen::Shell
index f6a7276..1b50c96 100644 (file)
@@ -35,6 +35,7 @@ class Canvas;
 namespace Tizen { namespace Graphics { namespace _Text
 {
 class TextObject;
+class TextSimple;
 }}} // Tizen::Graphics::_Text
 
 namespace Tizen { namespace Shell
@@ -67,6 +68,7 @@ private:
        std::unique_ptr<_LiveboxViewModel> __pLiveboxViewModel;
        std::unique_ptr<Tizen::Graphics::Font> __pFont;
        std::unique_ptr<Tizen::Graphics::_Text::TextObject> __pTextObject;
+       Tizen::Graphics::_Text::TextSimple* __pSimpleText;
 }; // _LiveboxViewPresenter
 
 }} // Tizen::Shell