#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/devel-api/controls/tool-bar/tool-bar.h>
-#include <dali-toolkit/devel-api/styling/style-manager.h>
namespace DemoHelper
toolBarLayer.RaiseToTop();
// Tool bar
- Dali::Image image = Dali::ResourceImage::New( toolbarImagePath );
toolBar = Dali::Toolkit::ToolBar::New();
toolBar.SetName( "TOOLBAR" );
- toolBar.SetBackgroundImage( image );
+ Dali::Property::Map background;
+ background["url"] = toolbarImagePath;
+ toolBar.SetProperty( Dali::Toolkit::Control::Property::BACKGROUND, background );
toolBar.SetParentOrigin( Dali::ParentOrigin::TOP_CENTER );
toolBar.SetAnchorPoint( Dali::AnchorPoint::TOP_CENTER );
toolBar.SetResizePolicy( Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::ALL_DIMENSIONS );
- // Add the tool bar to the too bar layer.
+ // Add the tool bar to the tool bar layer.
toolBarLayer.Add( toolBar );
// Tool bar text.
{
Dali::Toolkit::TextLabel label = Dali::Toolkit::TextLabel::New();
label.SetAnchorPoint( Dali::AnchorPoint::TOP_LEFT );
- label.SetDrawMode( Dali::DrawMode::OVERLAY );
label.SetProperty( Dali::Toolkit::Control::Property::STYLE_NAME, "toolbarlabel" );
label.SetProperty( Dali::Toolkit::TextLabel::Property::TEXT, title );
label.SetProperty( Dali::Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
// Set background image, loading it at screen resolution:
if ( !backgroundImagePath.empty() )
{
- Dali::Image backgroundImage = Dali::ResourceImage::New( backgroundImagePath, Dali::ImageDimensions( stage.GetSize().x, stage.GetSize().y ), Dali::FittingMode::SCALE_TO_FILL, Dali::SamplingMode::BOX_THEN_LINEAR );
- view.SetBackgroundImage( backgroundImage );
+ Dali::Property::Map map;
+ map["rendererType"] = "IMAGE";
+ map["url"] = backgroundImagePath;
+ map["desiredWidth"] = stage.GetSize().x;
+ map["desiredHeight"] = stage.GetSize().y;
+ map["fittingMode"] = "SCALE_TO_FILL";
+ map["samplingMode"] = "BOX_THEN_LINEAR";
+ map["synchronousLoading"] = true;
+ view.SetProperty( Dali::Toolkit::Control::Property::BACKGROUND, map );
}
// FIXME
{
Dali::Toolkit::TextLabel label = Dali::Toolkit::TextLabel::New( text );
label.SetProperty( Dali::Toolkit::Control::Property::STYLE_NAME, "toolbarlabel" );
- label.SetDrawMode( Dali::DrawMode::OVERLAY );
label.SetProperty( Dali::Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
label.SetProperty( Dali::Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
label.SetResizePolicy( Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::HEIGHT );