X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=shared%2Fview.h;h=e27e3746d513f3ba2d20ba7b954d6d3e2c433496;hb=2e182925204bf3ef9f2a36cbfbf998e79fbafaf5;hp=2606fd26461f1d4a2db9f5f5fdb6a8653ff19ac4;hpb=adf210149fc391c9176d667e43e8d8b5a429cb57;p=platform%2Fcore%2Fuifw%2Fdali-demo.git diff --git a/shared/view.h b/shared/view.h index 2606fd2..e27e374 100644 --- a/shared/view.h +++ b/shared/view.h @@ -1,5 +1,5 @@ -#ifndef __DALI_DEMO_HELPER_VIEW_H__ -#define __DALI_DEMO_HELPER_VIEW_H__ +#ifndef DALI_DEMO_HELPER_VIEW_H +#define DALI_DEMO_HELPER_VIEW_H /* * Copyright (c) 2014 Samsung Electronics Co., Ltd. @@ -46,7 +46,6 @@ struct ViewStyle const ViewStyle DEFAULT_VIEW_STYLE( 0.1f, 0.7f, 80.f, 4.f ); const char* DEFAULT_TEXT_STYLE_FONT_FAMILY("HelveticaNue"); -const char* DEFAULT_TEXT_STYLE_FONT_STYLE("Regular"); const float DEFAULT_TEXT_STYLE_POINT_SIZE( 8.0f ); const Dali::Toolkit::Alignment::Padding DEFAULT_PLAY_PADDING(12.0f, 12.0f, 12.0f, 12.0f); @@ -67,23 +66,23 @@ Dali::Layer CreateToolbar( Dali::Toolkit::ToolBar& toolBar, Dali::Stage stage = Dali::Stage::GetCurrent(); Dali::Layer toolBarLayer = Dali::Layer::New(); - toolBarLayer.SetName( "TOOLBAR_LAYER" ); - toolBarLayer.SetAnchorPoint( Dali::AnchorPoint::TOP_CENTER ); - toolBarLayer.SetParentOrigin( Dali::ParentOrigin::TOP_CENTER ); + toolBarLayer.SetProperty( Dali::Actor::Property::NAME, "TOOLBAR_LAYER" ); + toolBarLayer.SetProperty( Dali::Actor::Property::ANCHOR_POINT, Dali::AnchorPoint::TOP_CENTER ); + toolBarLayer.SetProperty( Dali::Actor::Property::PARENT_ORIGIN, Dali::ParentOrigin::TOP_CENTER ); toolBarLayer.SetResizePolicy( Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::WIDTH ); - toolBarLayer.SetSize( 0.0f, style.mToolBarHeight ); + toolBarLayer.SetProperty( Dali::Actor::Property::SIZE, Dali::Vector2( 0.0f, style.mToolBarHeight ) ); // Raise tool bar layer to the top. toolBarLayer.RaiseToTop(); // Tool bar toolBar = Dali::Toolkit::ToolBar::New(); - toolBar.SetName( "TOOLBAR" ); + toolBar.SetProperty( Dali::Actor::Property::NAME, "TOOLBAR" ); 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.SetProperty( Dali::Actor::Property::PARENT_ORIGIN, Dali::ParentOrigin::TOP_CENTER ); + toolBar.SetProperty( Dali::Actor::Property::ANCHOR_POINT, Dali::AnchorPoint::TOP_CENTER ); toolBar.SetResizePolicy( Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::ALL_DIMENSIONS ); // Add the tool bar to the tool bar layer. @@ -93,8 +92,8 @@ Dali::Layer CreateToolbar( Dali::Toolkit::ToolBar& toolBar, if( !title.empty() ) { Dali::Toolkit::TextLabel label = Dali::Toolkit::TextLabel::New(); - label.SetAnchorPoint( Dali::AnchorPoint::TOP_LEFT ); - label.SetProperty( Dali::Toolkit::Control::Property::STYLE_NAME, "toolbarlabel" ); + label.SetProperty( Dali::Actor::Property::ANCHOR_POINT, Dali::AnchorPoint::TOP_LEFT ); + label.SetStyleName( "ToolbarLabel" ); label.SetProperty( Dali::Toolkit::TextLabel::Property::TEXT, title ); label.SetProperty( Dali::Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); label.SetProperty( Dali::Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); @@ -118,10 +117,13 @@ Dali::Layer CreateView( Dali::Application& application, { Dali::Stage stage = Dali::Stage::GetCurrent(); + // Hide the indicator bar + application.GetWindow().ShowIndicator( Dali::Window::INVISIBLE ); + // Create default View. view = Dali::Toolkit::Control::New(); - view.SetAnchorPoint( Dali::AnchorPoint::CENTER ); - view.SetParentOrigin( Dali::ParentOrigin::CENTER ); + view.SetProperty( Dali::Actor::Property::ANCHOR_POINT, Dali::AnchorPoint::CENTER ); + view.SetProperty( Dali::Actor::Property::PARENT_ORIGIN, Dali::ParentOrigin::CENTER ); view.SetResizePolicy( Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::ALL_DIMENSIONS ); // Add the view to the stage before setting the background. @@ -153,8 +155,8 @@ Dali::Layer CreateView( Dali::Application& application, // Create a content layer. Dali::Layer contentLayer = Dali::Layer::New(); - contentLayer.SetAnchorPoint( Dali::AnchorPoint::CENTER ); - contentLayer.SetParentOrigin( Dali::ParentOrigin::CENTER ); + contentLayer.SetProperty( Dali::Actor::Property::ANCHOR_POINT, Dali::AnchorPoint::CENTER ); + contentLayer.SetProperty( Dali::Actor::Property::PARENT_ORIGIN, Dali::ParentOrigin::CENTER ); contentLayer.SetResizePolicy( Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::ALL_DIMENSIONS ); view.Add( contentLayer ); contentLayer.LowerBelow( toolBarLayer ); @@ -165,7 +167,7 @@ Dali::Layer CreateView( Dali::Application& application, Dali::Toolkit::TextLabel CreateToolBarLabel( const std::string& text ) { Dali::Toolkit::TextLabel label = Dali::Toolkit::TextLabel::New( text ); - label.SetProperty( Dali::Toolkit::Control::Property::STYLE_NAME, "toolbarlabel" ); + label.SetStyleName( "ToolbarLabel" ); 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 ); @@ -175,4 +177,4 @@ Dali::Toolkit::TextLabel CreateToolBarLabel( const std::string& text ) } // DemoHelper -#endif // __DALI_DEMO_HELPER_VIEW_H__ +#endif // DALI_DEMO_HELPER_VIEW_H