/*
- * 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.
// EXTERNAL INCLUDES
#include <dali/dali.h>
#include <dali-toolkit/dali-toolkit.h>
-#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
#include <dali-toolkit/devel-api/controls/navigation-view/navigation-view.h>
// INTERNAL INCLUDES
MULTI_COLOR_TEXT_WITH_STYLE,
MULTI_COLOR_TEXT_WITH_EMOJI,
MULTI_COLOR_TEXT_WITH_STYLE_EMOJI,
+ SMALL_TEXT_IN_LARGE_TEXT_LABEL,
NUMBER_OF_TYPES
};
"Multi color text",
"Multi color text with style",
"Multi color text with emoji",
- "Multi color text with style and emoji"
+ "Multi color text with style and emoji",
+ "Small text in large Text Label"
};
const int NUMBER_OF_LABELS = 500;
label.SetAnchorPoint( AnchorPoint::TOP_LEFT );
label.SetProperty( TextLabel::Property::TEXT_COLOR, Color::BLACK );
label.SetProperty( TextLabel::Property::POINT_SIZE, 12.0f );
- label.SetProperty( TextLabel::Property::SHADOW_COLOR, Color::YELLOW );
+ Property::Map shadowMap;
+ shadowMap.Insert( "color", Color::YELLOW );
+ label.SetProperty( TextLabel::Property::SHADOW, shadowMap );
label.SetProperty( TextLabel::Property::ENABLE_MARKUP, true );
Vector2 stageSize = Stage::GetCurrent().GetSize();
case SINGLE_COLOR_TEXT:
{
label.SetProperty( TextLabel::Property::TEXT, "A Quick Brown Fox Jumps Over The Lazy Dog" );
- label.SetProperty( TextLabel::Property::SHADOW_OFFSET, Vector2( 0.0f, 0.0f ) );
+
+ shadowMap.Insert( "offset", Vector2( 0.0f, 0.0f ) );
+ label.SetProperty( TextLabel::Property::SHADOW, shadowMap );
break;
}
case SINGLE_COLOR_TEXT_WITH_STYLE:
{
label.SetProperty( TextLabel::Property::TEXT, "A Quick Brown Fox Jumps Over The Lazy Dog" );
- label.SetProperty( TextLabel::Property::SHADOW_OFFSET, Vector2( 2.0f, 2.0f ) );
+
+ shadowMap.Insert( "offset", Vector2( 2.0f, 2.0f ) );
+ label.SetProperty( TextLabel::Property::SHADOW, shadowMap );
break;
}
case SINGLE_COLOR_TEXT_WITH_EMOJI:
{
label.SetProperty( TextLabel::Property::TEXT, "\xF0\x9F\x98\x81 A Quick Brown Fox Jumps Over The Lazy Dog" );
- label.SetProperty( TextLabel::Property::SHADOW_OFFSET, Vector2( 0.0f, 0.0f ) );
+
+ shadowMap.Insert( "offset", Vector2( 0.0f, 0.0f ) );
+ label.SetProperty( TextLabel::Property::SHADOW, shadowMap );
break;
}
case SINGLE_COLOR_TEXT_WITH_STYLE_EMOJI:
{
label.SetProperty( TextLabel::Property::TEXT, "\xF0\x9F\x98\x81 A Quick Brown Fox Jumps Over The Lazy Dog" );
- label.SetProperty( TextLabel::Property::SHADOW_OFFSET, Vector2( 2.0f, 2.0f ) );
+
+ shadowMap.Insert( "offset", Vector2( 2.0f, 2.0f ) );
+ label.SetProperty( TextLabel::Property::SHADOW, shadowMap );
break;
}
case MULTI_COLOR_TEXT:
{
label.SetProperty( TextLabel::Property::TEXT, "A <color value='cyan'>Quick Brown Fox</color> Jumps Over The <color value='yellow'>Lazy Dog</color>" );
- label.SetProperty( TextLabel::Property::SHADOW_OFFSET, Vector2( 0.0f, 0.0f ) );
+
+ shadowMap.Insert( "offset", Vector2( 0.0f, 0.0f ) );
+ label.SetProperty( TextLabel::Property::SHADOW, shadowMap );
break;
}
case MULTI_COLOR_TEXT_WITH_STYLE:
{
label.SetProperty( TextLabel::Property::TEXT, "A <color value='cyan'>Quick Brown Fox</color> Jumps Over The <color value='yellow'>Lazy Dog</color>" );
- label.SetProperty( TextLabel::Property::SHADOW_OFFSET, Vector2( 2.0f, 2.0f ) );
+
+ shadowMap.Insert( "offset", Vector2( 2.0f, 2.0f ) );
+ label.SetProperty( TextLabel::Property::SHADOW, shadowMap );
break;
}
case MULTI_COLOR_TEXT_WITH_EMOJI:
{
label.SetProperty( TextLabel::Property::TEXT, " \xF0\x9F\x98\x81 A <color value='cyan'>Quick Brown Fox</color> Jumps Over The <color value='yellow'>Lazy Dog</color>" );
- label.SetProperty( TextLabel::Property::SHADOW_OFFSET, Vector2( 0.0f, 0.0f ) );
+
+ shadowMap.Insert( "offset", Vector2( 0.0f, 0.0f ) );
+ label.SetProperty( TextLabel::Property::SHADOW, shadowMap );
break;
}
case MULTI_COLOR_TEXT_WITH_STYLE_EMOJI:
{
label.SetProperty( TextLabel::Property::TEXT, " \xF0\x9F\x98\x81 A <color value='cyan'>Quick Brown Fox</color> Jumps Over The <color value='yellow'>Lazy Dog</color>" );
- label.SetProperty( TextLabel::Property::SHADOW_OFFSET, Vector2( 2.0f, 2.0f ) );
+
+ shadowMap.Insert( "offset", Vector2( 2.0f, 2.0f ) );
+ label.SetProperty( TextLabel::Property::SHADOW, shadowMap );
+ break;
+ }
+ case SMALL_TEXT_IN_LARGE_TEXT_LABEL:
+ {
+ label.SetProperty( TextLabel::Property::TEXT, "A Quick Brown Fox Jumps Over The Lazy Dog" );
+
+ shadowMap.Insert( "offset", Vector2( 0.0f, 0.0f ) );
+ label.SetProperty( TextLabel::Property::SHADOW, shadowMap );
+ label.SetSize(stageSize.x, stageSize.y * 0.25f); // Set the text label in larger size
break;
}
default:
// Create a back button in the left of toolbar
PushButton backButton = PushButton::New();
- backButton.SetProperty( DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, BACK_IMAGE );
- backButton.SetProperty( DevelButton::Property::SELECTED_BACKGROUND_VISUAL, BACK_IMAGE_SELECTED );
+ backButton.SetProperty( Button::Property::UNSELECTED_BACKGROUND_VISUAL, BACK_IMAGE );
+ backButton.SetProperty( Button::Property::SELECTED_BACKGROUND_VISUAL, BACK_IMAGE_SELECTED );
backButton.ClickedSignal().Connect( this, &TextMemoryProfilingExample::OnBackButtonPressed );
backButton.SetLeaveRequired( true );
mToolBar.AddControl( backButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Alignment::HorizontalLeft, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );