Using migrated Public Visual API
[platform/core/uifw/dali-demo.git] / examples / text-editor / text-editor-example.cpp
index 23d9dbb..866bded 100644 (file)
@@ -34,6 +34,7 @@ using namespace Dali::Toolkit;
 namespace
 {
 
+const char * const THEME_PATH( DEMO_STYLE_DIR "text-editor-example-theme.json" ); ///< The theme used for this example
 const Vector4 BACKGROUND_COLOR( 0.04f, 0.345f, 0.392f, 1.0f );      ///< The background color.
 const char*   TOOLBAR_IMAGE = DEMO_IMAGE_DIR "top-bar.png";         ///< The tool-bar image.
 const float   TOOLBAR_BUTTON_PERCENTAGE = 0.1f;                     ///< The button's space width as a percentage of the toolbar's width.
@@ -129,7 +130,7 @@ public:
     // Add border to highlight harder-to-see colors.
     // We use a color rather than border visual as the container will always be behind the button.
     Property::Map colorMap;
-    colorMap.Insert( Visual::Property::TYPE, Visual::COLOR);
+    colorMap.Insert( Toolkit::Visual::Property::TYPE, Visual::COLOR);
     colorMap.Insert( ColorVisual::Property::MIX_COLOR, Color::BLACK );
     mColorContainer.SetProperty( Control::Property::BACKGROUND, colorMap );
 
@@ -182,6 +183,8 @@ public:
     mEditor.InputStyleChangedSignal().Connect( this, &TextEditorExample::OnTextInputStyleChanged );
 
     contents.Add( mEditor );
+    StyleManager styleManager = StyleManager::Get();
+    styleManager.ApplyTheme( THEME_PATH );
   }
 
   void CreateButtonContainer()
@@ -273,7 +276,7 @@ public:
   void SetButtonColor( Button& button, const Vector4& color )
   {
     Property::Map colorVisualMap;
-    colorVisualMap.Add( Visual::Property::TYPE, Visual::COLOR )
+    colorVisualMap.Add( Toolkit::Visual::Property::TYPE, Visual::COLOR )
                   .Add( ColorVisual::Property::MIX_COLOR, color );
 
     button.SetProperty( DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, colorVisualMap );