apply shadow text
authorMyung Jin Kim <critical.kim@samsung.com>
Fri, 6 Sep 2013 05:44:20 +0000 (14:44 +0900)
committerMyung Jin Kim <critical.kim@samsung.com>
Fri, 6 Sep 2013 05:44:20 +0000 (14:44 +0900)
Change-Id: I6d7d557cf031dfa98639e68e898b78f18dd8e987

src/ui/controls/FUiCtrl_ButtonPresenter.cpp
src/ui/controls/FUiCtrl_ToolbarPresenter.cpp

index 2a54959..7709097 100644 (file)
@@ -160,6 +160,9 @@ _ButtonPresenter::InitTextObject(void)
        pSimpleText = new (std::nothrow) TextSimple(const_cast<wchar_t*>(__pButton->GetText().GetPointer()), __pButton->GetText().GetLength());
        SysTryReturn(NID_UI_CTRL, pSimpleText, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
 
+       pSimpleText->SetTextShadowEnabled(true);
+       pSimpleText->SetTextShadowOffset(FloatPoint(0.0f, 2.0f));
+
        __pTextObject->AppendElement(*pSimpleText);
        __pTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_WORD);
        __pTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_ABBREV);
@@ -862,6 +865,20 @@ _ButtonPresenter::DrawText(void)
                __pTextObject->Compose();
        }
 
+       _Text::TextElement* pTextElement = __pTextObject->GetElementAtElementIndex(0);
+       TextSimple* pSimpleText = dynamic_cast <TextSimple*>(pTextElement);
+       if (pSimpleText)
+       {
+               if (__pButton->GetButtonStatus() == _BUTTON_STATUS_PRESSED)
+               {
+                       pSimpleText->SetTextShadowOffset(FloatPoint(0.0f, -2.0f));
+               }
+               else
+               {
+                       pSimpleText->SetTextShadowOffset(FloatPoint(0.0f, 2.0f));
+               }
+       }
+
        __pTextObject->SetForegroundColor(__pButton->GetTextColor(__pButton->GetButtonStatus()), 0, __pTextObject->GetTextLength());
 
        if (__pTextObject->IsActionOn() == true)
index 4d82878..ed16a17 100644 (file)
@@ -1138,7 +1138,12 @@ _ToolbarPresenter::SetDescriptionText(const String& description)
                return E_OUT_OF_MEMORY;
        }
        __pDescriptionTextObject->Construct();
+
        TextSimple* pSimpleText = new (std::nothrow) TextSimple(tempString, length, TEXT_ELEMENT_SOURCE_TYPE_EXTERNAL);
+
+       pSimpleText->SetTextShadowEnabled(true);
+       pSimpleText->SetTextShadowOffset(FloatPoint(0.0f, 2.0f));
+
        __pDescriptionTextObject->AppendElement(*pSimpleText);
        __pDescriptionTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_ABBREV);
        __pDescriptionTextObject->SetAlignment(TEXT_OBJECT_ALIGNMENT_CENTER);
@@ -1228,9 +1233,13 @@ _ToolbarPresenter::SetTitleText(const String& title, HorizontalAlignment alignme
        }
        __pTitleTextObject->Construct();
        __pTitleTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_NONE);
+
        TextSimple* pSimpleText = new (std::nothrow) TextSimple(tempString, length, TEXT_ELEMENT_SOURCE_TYPE_EXTERNAL);
-       __pTitleTextObject->AppendElement(*pSimpleText);
 
+       pSimpleText->SetTextShadowEnabled(true);
+       pSimpleText->SetTextShadowOffset(FloatPoint(0.0f, 2.0f));
+
+       __pTitleTextObject->AppendElement(*pSimpleText);
        __pTitleTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_ABBREV);
 
        __titleSliding = false;