X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=examples%2Ftext-scrolling%2Ftext-scrolling-example.cpp;h=e8863311d42a408d2e7615bf4b211bd13e3c8c41;hb=3e41735399af818651d561a71f6d47993820acc7;hp=6b3f047b902de3eb586525c72fe72720b4151082;hpb=312470da17142a335f5f743630b7fc19c0061ead;p=platform%2Fcore%2Fuifw%2Fdali-demo.git diff --git a/examples/text-scrolling/text-scrolling-example.cpp b/examples/text-scrolling/text-scrolling-example.cpp index 6b3f047..e886331 100644 --- a/examples/text-scrolling/text-scrolling-example.cpp +++ b/examples/text-scrolling/text-scrolling-example.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,14 +22,13 @@ // EXTERNAL INCLUDES #include -#include using namespace Dali; using namespace Dali::Toolkit; namespace { -const Vector2 DESKTOP_SIZE( Vector2( 1440.f, 1600.f ) ); +const float STAGE_HEIGHT_MULTIPLIER( 1.5f ); const Vector2 BOX_SIZE( Vector2(330.0f, 80.0f ) ); const Vector2 SCROLLING_BOX_SIZE( Vector2(330.0f, 40.0f ) ); const float MAX_OFFSCREEN_RENDERING_SIZE = 2048.f; @@ -136,7 +135,7 @@ public: mAnimation = Animation::New( 1.0f ); - const Size mTargetActorSize( mStageSize.width, DESKTOP_SIZE.height ); + const Size mTargetActorSize( mStageSize.width, mStageSize.height * STAGE_HEIGHT_MULTIPLIER ); // Create Desktop Control desktop = Control::New(); @@ -174,15 +173,16 @@ public: scrollLargeButton.ClickedSignal().Connect( this, &TextScrollingExample::OnButtonClickedLarge ); CreateLabel( mLargeLabel, "A Quick Brown Fox Jumps Over The Lazy Dog", boxB, false ,scrollLargeButton ); - CreateBox( "boxC", boxC, desktop, SCROLLING_BOX_SIZE ); boxC.SetPosition( 0.0f, -300.0f, 1.0f ); Toolkit::PushButton scrollSmallButton = Toolkit::PushButton::New(); scrollSmallButton.ClickedSignal().Connect( this, &TextScrollingExample::OnButtonClickedSmall ); CreateLabel( mSmallLabel, "Hello Text", boxC , true, scrollSmallButton ); mSmallLabel.SetProperty( TextLabel::Property::TEXT_COLOR, Color::BLACK ); - mSmallLabel.SetProperty( TextLabel::Property::SHADOW_OFFSET, Vector2( 1.0f, 1.0f ) ); - mSmallLabel.SetProperty( TextLabel::Property::SHADOW_COLOR, Color::CYAN ); + Property::Map shadowMap; + shadowMap.Insert( "color", Color::CYAN ); + shadowMap.Insert( "offset", Vector2( 1.0f, 1.0f ) ); + mSmallLabel.SetProperty( TextLabel::Property::SHADOW, shadowMap ); CreateBox( "boxD", boxD, desktop, SCROLLING_BOX_SIZE ); boxD.SetPosition( 0.0f, -200.0f, 1.0f ); @@ -208,8 +208,8 @@ public: Toolkit::PushButton colorButton = Toolkit::PushButton::New(); colorButton.SetProperty( Button::Property::TOGGLABLE, true ); - colorButton.SetProperty( DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, Property::Map().Add ( Toolkit::Visual::Property::TYPE, Visual::COLOR ).Add( ColorVisual::Property::MIX_COLOR, Color::RED ) ); - colorButton.SetProperty( DevelButton::Property::SELECTED_BACKGROUND_VISUAL, Property::Map().Add ( Toolkit::Visual::Property::TYPE, Visual::COLOR ).Add( ColorVisual::Property::MIX_COLOR, Color::BLACK ) ); + colorButton.SetProperty( Button::Property::UNSELECTED_BACKGROUND_VISUAL, Property::Map().Add ( Toolkit::Visual::Property::TYPE, Visual::COLOR ).Add( ColorVisual::Property::MIX_COLOR, Color::RED ) ); + colorButton.SetProperty( Button::Property::SELECTED_BACKGROUND_VISUAL, Property::Map().Add ( Toolkit::Visual::Property::TYPE, Visual::COLOR ).Add( ColorVisual::Property::MIX_COLOR, Color::BLACK ) ); colorButton.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER ); colorButton.SetParentOrigin( ParentOrigin::BOTTOM_CENTER ); colorButton.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS ); @@ -320,7 +320,9 @@ public: mToggleColor = true; } - mSmallLabel.SetProperty( TextLabel::Property::SHADOW_COLOR, Color::BLACK ); + Property::Map shadowMap; + shadowMap.Insert( "color", Color::BLACK ); + mSmallLabel.SetProperty( TextLabel::Property::SHADOW, shadowMap ); mSmallLabel.SetProperty( TextLabel::Property::TEXT_COLOR, color ); mRtlLabel.SetProperty( TextLabel::Property::TEXT_COLOR, color ); mLargeLabel.SetProperty( TextLabel::Property::TEXT_COLOR, color );