Changed default state text size
authortaeyoon0.lee <taeyoon0.lee@samsung.com>
Wed, 8 Feb 2017 07:55:43 +0000 (16:55 +0900)
committerTaeyoon Lee <taeyoon0.lee@samsung.com>
Thu, 1 Jun 2017 04:36:18 +0000 (04:36 +0000)
  Default size: 30 (pixel)
  Pixel to Point for TextLabel

Change-Id: I83f93c636eddb0c95f4e609196951c3ee006f5b5

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

index 5e1d5e7..02b6873 100644 (file)
@@ -51,6 +51,8 @@ namespace Internal
 namespace
 {
 
+const int DEFAULT_FONT_PIXEL_SIZE = 30; // Referred platform widget viewer evas
+
 #define GET_LOCALE_TEXT(string) dgettext(PKGNAME, string)
 
 #if defined(DEBUG_ENABLED)
@@ -742,6 +744,7 @@ void WidgetView::OnInitialize()
   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" );
+  mStateText.SetProperty( Toolkit::TextLabel::Property::POINT_SIZE, TextPixelToPointSize( DEFAULT_FONT_PIXEL_SIZE ) );
 
   mPreviewActor.Add( mStateTextActor );
   mStateTextActor.Add( mStateText );
@@ -993,6 +996,14 @@ void WidgetView::SetLoadingTextPropertyMap( Property::Map map )
   }
 }
 
+float WidgetView::TextPixelToPointSize( int pixelSize )
+{
+  Dali::Vector2 dpi = Dali::Stage::GetCurrent().GetDpi();
+  float meanDpi = (dpi.height + dpi.width) / 2.0f;
+
+  return (pixelSize * 72.0f) / meanDpi;
+}
+
 } // namespace Internal
 
 } // namespace WidgetView
index d6af8fe..40aec7e 100644 (file)
@@ -197,6 +197,8 @@ protected:
    */
   virtual ~WidgetView();
 
+  float TextPixelToPointSize( int pixelSize );
+
 private: // From Control
 
   /**