Added property map for loading text and changed default color and style
authortaeyoon <taeyoon0.lee@samsung.com>
Tue, 20 Dec 2016 11:31:48 +0000 (20:31 +0900)
committerTaeyoon Lee <taeyoon0.lee@samsung.com>
Thu, 1 Jun 2017 04:13:50 +0000 (04:13 +0000)
  Added property map for changing loading text size, font style and color
  Changed text color, and font style

Change-Id: Ib7bbb2890daf0c931f91e8a8441fd3382eec5c5c

internal/widget_view/widget_view_impl.cpp
internal/widget_view/widget_view_impl.h

index 346e7ee..9be9ba3 100644 (file)
@@ -89,6 +89,10 @@ DALI_TYPE_REGISTRATION_END()
 
 struct wl_buffer* preBuffer;
 
+const char* const FONT_STYLE( "fontStyle" );
+const char* const TEXT_POINT_SIZE( "textPointSize" );
+const char* const TEXT_COLOR( "textColor" );
+
 static void OnBufferUpdated( struct tizen_remote_surface *surface, uint32_t type, struct wl_buffer *buffer,
                               int32_t img_file_fd, uint32_t img_file_size, uint32_t time, struct wl_array *keys,
                               const char *appid, const char *instance_id, const int pid, void *data)
@@ -553,6 +557,7 @@ void WidgetView::SetProperty( BaseObject* object, Property::Index index, const P
       case Dali::WidgetView::WidgetView::Property::PREVIEW:
       {
         bool previewEnabled;
+
         if( value.Get( previewEnabled ) )
         {
           impl.ShowPreview( previewEnabled );
@@ -562,10 +567,16 @@ void WidgetView::SetProperty( BaseObject* object, Property::Index index, const P
       case Dali::WidgetView::WidgetView::Property::LOADING_TEXT:
       {
         bool textEnabled;
+        Property::Map map;
+
         if( value.Get( textEnabled ) )
         {
           impl.ShowStateText( textEnabled );
         }
+        else if( value.Get( map ) )
+        {
+          impl.SetLoadingTextPropertyMap( map );
+        }
         break;
       }
       case Dali::WidgetView::WidgetView::Property::PERMANENT_DELETE:
@@ -738,6 +749,8 @@ void WidgetView::OnInitialize()
   mStateText.SetAnchorPoint( AnchorPoint::CENTER );
   mStateText.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
   mStateText.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
+  mStateText.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Dali::Color::WHITE );
+  mStateText.SetProperty( Toolkit::TextLabel::Property::FONT_STYLE, "Bold" );
 
   mPreviewActor.Add( mStateTextActor );
   mStateTextActor.Add( mStateText );
@@ -928,6 +941,36 @@ void WidgetView::CloseRemoteSurface()
   mRemoteSurface = NULL;
 }
 
+void WidgetView::SetLoadingTextPropertyMap( Property::Map map )
+{
+  if( mStateText )
+  {
+    Property::Value* fontStyle = map.Find( FONT_STYLE );
+    std::string style;
+
+    if( fontStyle && fontStyle->Get( style ) )
+    {
+      mStateText.SetProperty( Toolkit::TextLabel::Property::FONT_STYLE, style );
+    }
+
+    Property::Value* textPointSize = map.Find( TEXT_POINT_SIZE );
+    float size = 0.f;
+
+    if( textPointSize && textPointSize->Get( size ) )
+    {
+      mStateText.SetProperty( Toolkit::TextLabel::Property::POINT_SIZE, size );
+    }
+
+    Property::Value* textColor = map.Find( TEXT_COLOR );
+    Vector4 color;
+
+    if( textColor && textColor->Get( color ) )
+    {
+      mStateText.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, color );
+    }
+  }
+}
+
 } // namespace Internal
 
 } // namespace WidgetView
index 3d3079d..9c5cef6 100644 (file)
@@ -143,6 +143,8 @@ public: // Internal API
 
   void CloseRemoteSurface();
 
+  void SetLoadingTextPropertyMap( Dali::Property::Map map );
+
 public: //Signals
 
   /**