Add FontSizeScale in TextStyle
authorBowon Ryu <bowon.ryu@samsung.com>
Fri, 11 Nov 2022 09:26:16 +0000 (18:26 +0900)
committerJaehyun Cho <jaehyun0cho@gmail.com>
Wed, 23 Nov 2022 09:19:17 +0000 (18:19 +0900)
Setting FontSizeScale to UseSystemSetting in Theme,
the default font scale follows the properties of system.

- Added new argument to New(bool hasStlye)
- If true, DALi's json is no longer used in Text components
- If false, use DALi's json.

- Fixed previous incorrect bindable property structure.

- This must be sync merged with patches below.
https://review.tizen.org/gerrit/#/c/platform/core/uifw/dali-toolkit/+/284113/
https://review.tizen.org/gerrit/#/c/platform/core/uifw/dali-csharp-binder/+/284127/

Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
13 files changed:
src/Tizen.NUI/src/internal/Interop/Interop.TextEditor.cs
src/Tizen.NUI/src/internal/Interop/Interop.TextField.cs
src/Tizen.NUI/src/internal/Interop/Interop.TextLabel.cs
src/Tizen.NUI/src/public/BaseComponents/Style/TextEditorStyle.cs
src/Tizen.NUI/src/public/BaseComponents/Style/TextFieldStyle.cs
src/Tizen.NUI/src/public/BaseComponents/Style/TextLabelStyle.cs
src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs
src/Tizen.NUI/src/public/BaseComponents/TextEditorBindableProperty.cs
src/Tizen.NUI/src/public/BaseComponents/TextField.cs
src/Tizen.NUI/src/public/BaseComponents/TextFieldBindableProperty.cs
src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs
src/Tizen.NUI/src/public/BaseComponents/TextLabelBindableProperty.cs
src/Tizen.NUI/src/public/Theme/DefaultThemeCommon.cs

index 9d7a4e7..f8090e9 100755 (executable)
@@ -162,6 +162,9 @@ namespace Tizen.NUI
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextEditor_New")]
             public static extern global::System.IntPtr New();
 
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextEditor_New_With_Style")]
+            public static extern global::System.IntPtr New(bool hasStyle);
+
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_TextEditor__SWIG_0")]
             public static extern global::System.IntPtr NewTextEditor();
 
index 86ad919..81b3f0c 100755 (executable)
@@ -171,6 +171,9 @@ namespace Tizen.NUI
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextField_New")]
             public static extern global::System.IntPtr New();
 
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextField_New_With_Style")]
+            public static extern global::System.IntPtr New(bool hasStyle);
+
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_TextField__SWIG_0")]
             public static extern global::System.IntPtr NewTextField();
 
index 787ff65..23ebfe0 100755 (executable)
@@ -88,7 +88,13 @@ namespace Tizen.NUI
             public static extern global::System.IntPtr New();
 
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_New__SWIG_1")]
-            public static extern global::System.IntPtr New(string jarg1);
+            public static extern global::System.IntPtr New(string text);
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_New_With_Style")]
+            public static extern global::System.IntPtr New(bool hasStyle);
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_New_With_String_Style")]
+            public static extern global::System.IntPtr New(string text, bool hasStyle);
 
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_TextLabel__SWIG_0")]
             public static extern global::System.IntPtr NewTextLabel();
index ddceba5..a1d046d 100755 (executable)
@@ -277,6 +277,18 @@ namespace Tizen.NUI.BaseComponents
         });
 
         [EditorBrowsable(EditorBrowsableState.Never)]
+        public static readonly BindableProperty FontSizeScaleProperty = BindableProperty.Create(nameof(FontSizeScale), typeof(float?), typeof(TextEditorStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+        {
+            var textEditorStyle = (TextEditorStyle)bindable;
+            textEditorStyle.fontSizeScale = (float?)newValue;
+        },
+        defaultValueCreator: (bindable) =>
+        {
+            var textEditorStyle = (TextEditorStyle)bindable;
+            return textEditorStyle.fontSizeScale;
+        });
+
+        [EditorBrowsable(EditorBrowsableState.Never)]
         public static readonly BindableProperty SelectionPopupStyleProperty = BindableProperty.Create(nameof(SelectionPopupStyle), typeof(PropertyMap), typeof(TextEditorStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
         {
             var textEditorStyle = (TextEditorStyle)bindable;
@@ -326,6 +338,7 @@ namespace Tizen.NUI.BaseComponents
         private float? lineSpacing;
         private float? minLineSize;
         private float? relativeLineHeight;
+        private float? fontSizeScale;
 
         static TextEditorStyle() { }
 
@@ -713,6 +726,13 @@ namespace Tizen.NUI.BaseComponents
         }
 
         [EditorBrowsable(EditorBrowsableState.Never)]
+        public float? FontSizeScale
+        {
+            get => (float?)GetValue(FontSizeScaleProperty);
+            set => SetValue(FontSizeScaleProperty, value);
+        }
+
+        [EditorBrowsable(EditorBrowsableState.Never)]
         public PropertyMap SelectionPopupStyle
         {
             get => (PropertyMap)GetValue(SelectionPopupStyleProperty);
index 965aaab..a370f46 100755 (executable)
@@ -50,6 +50,17 @@ namespace Tizen.NUI.BaseComponents
             var textFieldStyle = (TextFieldStyle)bindable;
             return textFieldStyle.pointSize;
         });
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static readonly BindableProperty FontSizeScaleProperty = BindableProperty.Create(nameof(FontSizeScale), typeof(float?), typeof(TextFieldStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+        {
+            var textFieldStyle = (TextFieldStyle)bindable;
+            textFieldStyle.fontSizeScale = (float?)newValue;
+        },
+        defaultValueCreator: (bindable) =>
+        {
+            var textFieldStyle = (TextFieldStyle)bindable;
+            return textFieldStyle.fontSizeScale;
+        });
         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
         public static readonly BindableProperty TextColorProperty = BindableProperty.Create(nameof(TextColor), typeof(Color), typeof(TextFieldStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
@@ -545,6 +556,7 @@ namespace Tizen.NUI.BaseComponents
         private string fontFamily;
         private Color textColor;
         private float? pointSize;
+        private float? fontSizeScale;
         private Vector4 placeholderTextColor;
         private Vector4 primaryCursorColor;
         private PropertyMap fontStyle;
@@ -845,6 +857,13 @@ namespace Tizen.NUI.BaseComponents
             set => SetValue(PointSizeProperty, value);
         }
 
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public float? FontSizeScale
+        {
+            get => (float?)GetValue(FontSizeScaleProperty);
+            set => SetValue(FontSizeScaleProperty, value);
+        }
+
         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
         public Vector4 PlaceholderTextColor
index e24271a..e86a49e 100755 (executable)
@@ -303,6 +303,17 @@ namespace Tizen.NUI.BaseComponents
             var textLabelStyle = (TextLabelStyle)bindable;
             return textLabelStyle.characterSpacing;
         });
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static readonly BindableProperty FontSizeScaleProperty = BindableProperty.Create(nameof(FontSizeScale), typeof(float?), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+        {
+            var textLabelStyle = (TextLabelStyle)bindable;
+            textLabelStyle.fontSizeScale = (float?)newValue;
+        },
+        defaultValueCreator: (bindable) =>
+        {
+            var textLabelStyle = (TextLabelStyle)bindable;
+            return textLabelStyle.fontSizeScale;
+        });
         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
         public static readonly BindableProperty MatchSystemLanguageDirectionProperty = BindableProperty.Create(nameof(MatchSystemLanguageDirection), typeof(bool?), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
@@ -365,6 +376,7 @@ namespace Tizen.NUI.BaseComponents
         private Selector<TextShadow> textShadow;
         private PropertyMap fontStyle;
         private float? characterSpacing;
+        private float? fontSizeScale;
 
         static TextLabelStyle() { }
 
@@ -554,6 +566,13 @@ namespace Tizen.NUI.BaseComponents
             set => SetValue(CharacterSpacingProperty, value);
         }
 
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public float? FontSizeScale
+        {
+            get => (float?)GetValue(FontSizeScaleProperty);
+            set => SetValue(FontSizeScaleProperty, value);
+        }
+
         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
         public bool? MatchSystemLanguageDirection
index 6cc5aa8..1a01402 100755 (executable)
@@ -39,6 +39,7 @@ namespace Tizen.NUI.BaseComponents
         private float fontSizeScale = 1.0f;
         private bool hasFontSizeChangedCallback = false;
         private bool isSettingTextInCSharp = false;
+        static private string defaultStyleName = "Tizen.NUI.BaseComponents.TextEditor";
 
 #if NUI_PROPERTY_CHANGE_2
         private Color internalPlaceholderTextColor = null;
@@ -57,7 +58,7 @@ namespace Tizen.NUI.BaseComponents
         /// Creates the TextEditor control.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
-        public TextEditor() : this(Interop.TextEditor.New(), true)
+        public TextEditor() : this(Interop.TextEditor.New(ThemeManager.GetStyle(defaultStyleName) == null ? false : true), true)
         {
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
@@ -66,7 +67,7 @@ namespace Tizen.NUI.BaseComponents
         /// Creates the TextEditor with specified style.
         /// </summary>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public TextEditor(TextEditorStyle style) : this(Interop.TextLabel.New(), true, style: style)
+        public TextEditor(TextEditorStyle style) : this(Interop.TextEditor.New(ThemeManager.GetStyle(defaultStyleName) == null ? false : true), true, style: style)
         {
         }
 
@@ -76,7 +77,7 @@ namespace Tizen.NUI.BaseComponents
         /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
         /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public TextEditor(bool shown) : this(Interop.TextEditor.New(), true)
+        public TextEditor(bool shown) : this(Interop.TextEditor.New(ThemeManager.GetStyle(defaultStyleName) == null ? false : true), true)
         {
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             SetVisible(shown);
@@ -2170,6 +2171,19 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
+                return (float)GetValue(FontSizeScaleProperty);
+            }
+            set
+            {
+                SetValue(FontSizeScaleProperty, value);
+                NotifyPropertyChanged();
+            }
+        }
+
+        private float InternalFontSizeScale
+        {
+            get
+            {
                 return fontSizeScale;
             }
             set
@@ -2201,11 +2215,22 @@ namespace Tizen.NUI.BaseComponents
                     removeFontSizeChangedCallback();
                 }
 
-                SetValue(FontSizeScaleProperty, newFontSizeScale);
-                NotifyPropertyChanged();
+                SetInternalFontSizeScale(newFontSizeScale);
             }
         }
 
+        private void SetInternalFontSizeScale(float fontSizeScale)
+        {
+#if NUI_PROPERTY_CHANGE_2
+            Object.InternalSetPropertyFloat(this.SwigCPtr, TextEditor.Property.FontSizeScale, (float)fontSizeScale);
+#else
+            using (var property = new Tizen.NUI.PropertyValue((float)fontSizeScale))
+            {
+                Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)this.SwigCPtr, TextEditor.Property.FontSizeScale, property);
+            }
+#endif
+        }
+
         /// <summary>
         /// The EnableFontSizeScale property.<br />
         /// Whether the font size scale is enabled. (The default value is true)
@@ -2535,8 +2560,7 @@ namespace Tizen.NUI.BaseComponents
         private void SystemSettingsFontSizeChanged(object sender, FontSizeChangedEventArgs e)
         {
             float newFontSizeScale = TextUtils.GetFontSizeScale(e.Value);
-            SetValue(FontSizeScaleProperty, newFontSizeScale);
-            NotifyPropertyChanged();
+            SetInternalFontSizeScale(newFontSizeScale);
         }
 
         private void addFontSizeChangedCallback()
index 0130bc2..7307358 100755 (executable)
@@ -1364,26 +1364,13 @@ namespace Tizen.NUI.BaseComponents
             var textEditor = (TextEditor)bindable;
             if (newValue != null)
             {
-#if NUI_PROPERTY_CHANGE_2
-                Object.InternalSetPropertyFloat(textEditor.SwigCPtr, TextEditor.Property.FontSizeScale, (float)newValue);
-#else
-                using (var property = new Tizen.NUI.PropertyValue((float)newValue))
-                {
-                    Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)textEditor.SwigCPtr, TextEditor.Property.FontSizeScale, property);
-                }
-#endif
+                textEditor.InternalFontSizeScale = (float)newValue;
             }
         }),
         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
         {
             var textEditor = (TextEditor)bindable;
-#if NUI_PROPERTY_CHANGE_2
-            return Object.InternalGetPropertyFloat(textEditor.SwigCPtr, TextEditor.Property.FontSizeScale);
-#else
-            float temp;
-            Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)textEditor.SwigCPtr, TextEditor.Property.FontSizeScale).Get(out temp);
-            return temp;
-#endif
+            return textEditor.InternalFontSizeScale;
         }));
 
         [EditorBrowsable(EditorBrowsableState.Never)]
index ddcb809..e73f72e 100755 (executable)
@@ -39,6 +39,7 @@ namespace Tizen.NUI.BaseComponents
         private float fontSizeScale = 1.0f;
         private bool hasFontSizeChangedCallback = false;
         private bool isSettingTextInCSharp = false;
+        static private string defaultStyleName = "Tizen.NUI.BaseComponents.TextField";
 
 #if NUI_PROPERTY_CHANGE_2
         private Vector4 internalPlaceholderTextColor = null;
@@ -57,7 +58,7 @@ namespace Tizen.NUI.BaseComponents
         /// Creates the TextField control.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
-        public TextField() : this(Interop.TextField.New(), true)
+        public TextField() : this(Interop.TextField.New(ThemeManager.GetStyle(defaultStyleName) == null ? false : true), true)
         {
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
@@ -68,7 +69,7 @@ namespace Tizen.NUI.BaseComponents
         /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
         /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public TextField(bool shown) : this(Interop.TextField.New(), true)
+        public TextField(bool shown) : this(Interop.TextField.New(ThemeManager.GetStyle(defaultStyleName) == null ? false : true), true)
         {
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             SetVisible(shown);
@@ -2289,6 +2290,19 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
+                return (float)GetValue(FontSizeScaleProperty);
+            }
+            set
+            {
+                SetValue(FontSizeScaleProperty, value);
+                NotifyPropertyChanged();
+            }
+        }
+
+        private float InternalFontSizeScale
+        {
+            get
+            {
                 return fontSizeScale;
             }
             set
@@ -2320,11 +2334,22 @@ namespace Tizen.NUI.BaseComponents
                     removeFontSizeChangedCallback();
                 }
 
-                SetValue(FontSizeScaleProperty, newFontSizeScale);
-                NotifyPropertyChanged();
+                SetInternalFontSizeScale(newFontSizeScale);
             }
         }
 
+        private void SetInternalFontSizeScale(float fontSizeScale)
+        {
+#if NUI_PROPERTY_CHANGE_2
+            Object.InternalSetPropertyFloat(this.SwigCPtr, TextField.Property.FontSizeScale, (float)fontSizeScale);
+#else
+            using (var property = new Tizen.NUI.PropertyValue((float)fontSizeScale))
+            {
+                Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)this.SwigCPtr, TextField.Property.FontSizeScale, property);
+            }
+#endif
+        }
+
         /// <summary>
         /// The EnableFontSizeScale property.<br />
         /// Whether the font size scale is enabled. (The default value is true)
@@ -2545,8 +2570,7 @@ namespace Tizen.NUI.BaseComponents
         private void SystemSettingsFontSizeChanged(object sender, FontSizeChangedEventArgs e)
         {
             float newFontSizeScale = TextUtils.GetFontSizeScale(e.Value);
-            SetValue(FontSizeScaleProperty, newFontSizeScale);
-            NotifyPropertyChanged();
+            SetInternalFontSizeScale(newFontSizeScale);
         }
 
         private void addFontSizeChangedCallback()
index b31e794..1c9f345 100755 (executable)
@@ -1373,26 +1373,13 @@ namespace Tizen.NUI.BaseComponents
             var textField = (TextField)bindable;
             if (newValue != null)
             {
-#if NUI_PROPERTY_CHANGE_2
-                Object.InternalSetPropertyFloat(textField.SwigCPtr, TextField.Property.FontSizeScale, (float)newValue);
-#else
-                using (var property = new Tizen.NUI.PropertyValue((float)newValue))
-                {
-                    Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)textField.SwigCPtr, TextField.Property.FontSizeScale, property);
-                }
-#endif
+                textField.InternalFontSizeScale = (float)newValue;
             }
         }),
         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
         {
             var textField = (TextField)bindable;
-#if NUI_PROPERTY_CHANGE_2
-            return Object.InternalGetPropertyFloat(textField.SwigCPtr, TextField.Property.FontSizeScale);
-#else
-            float temp;
-            Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)textField.SwigCPtr, TextField.Property.FontSizeScale).Get(out temp);
-            return temp;
-#endif
+            return textField.InternalFontSizeScale;
         }));
 
         [EditorBrowsable(EditorBrowsableState.Never)]
index 7fc2b14..32bf727 100755 (executable)
@@ -86,6 +86,7 @@ namespace Tizen.NUI.BaseComponents
         private TextLabelSelectorData selectorData;
         private float fontSizeScale = 1.0f;
         private bool hasFontSizeChangedCallback = false;
+        static private string defaultStyleName = "Tizen.NUI.BaseComponents.TextLabel";
 
 #if NUI_PROPERTY_CHANGE_2
         private Color internalTextColor;
@@ -95,14 +96,14 @@ namespace Tizen.NUI.BaseComponents
         /// Creates the TextLabel control.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
-        public TextLabel() : this(Interop.TextLabel.New(), true)
+        public TextLabel() : this(Interop.TextLabel.New(ThemeManager.GetStyle(defaultStyleName) == null ? false : true), true)
         {
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
         /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public TextLabel(TextLabelStyle viewStyle) : this(Interop.TextLabel.New(), true, viewStyle)
+        public TextLabel(TextLabelStyle viewStyle) : this(Interop.TextLabel.New(ThemeManager.GetStyle(defaultStyleName) == null ? false : true), true, viewStyle)
         {
         }
 
@@ -112,7 +113,7 @@ namespace Tizen.NUI.BaseComponents
         /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
         /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public TextLabel(bool shown) : this(Interop.TextLabel.New(), true)
+        public TextLabel(bool shown) : this(Interop.TextLabel.New(ThemeManager.GetStyle(defaultStyleName) == null ? false : true), true)
         {
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             SetVisible(shown);
@@ -123,7 +124,7 @@ namespace Tizen.NUI.BaseComponents
         /// </summary>
         /// <param name="text">The text to display</param>
         /// <since_tizen> 3 </since_tizen>
-        public TextLabel(string text) : this(Interop.TextLabel.New(text), true)
+        public TextLabel(string text) : this(Interop.TextLabel.New(text, ThemeManager.GetStyle(defaultStyleName) == null ? false : true), true)
         {
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
@@ -135,7 +136,7 @@ namespace Tizen.NUI.BaseComponents
         /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
         /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public TextLabel(string text, bool shown) : this(Interop.TextLabel.New(text), true)
+        public TextLabel(string text, bool shown) : this(Interop.TextLabel.New(text, ThemeManager.GetStyle(defaultStyleName) == null ? false : true), true)
         {
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             SetVisible(shown);
@@ -1399,6 +1400,19 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
+                return (float)GetValue(FontSizeScaleProperty);
+            }
+            set
+            {
+                SetValue(FontSizeScaleProperty, value);
+                NotifyPropertyChanged();
+            }
+        }
+
+        private float InternalFontSizeScale
+        {
+            get
+            {
                 return fontSizeScale;
             }
             set
@@ -1430,11 +1444,23 @@ namespace Tizen.NUI.BaseComponents
                     removeFontSizeChangedCallback();
                 }
 
-                SetValue(FontSizeScaleProperty, newFontSizeScale);
-                NotifyPropertyChanged();
+                SetInternalFontSizeScale(newFontSizeScale);
             }
         }
 
+        private void SetInternalFontSizeScale(float fontSizeScale)
+        {
+#if NUI_PROPERTY_CHANGE_2
+            Object.InternalSetPropertyFloat(this.SwigCPtr, TextLabel.Property.FontSizeScale, (float)fontSizeScale);
+#else
+            using (var property = new Tizen.NUI.PropertyValue((float)fontSizeScale))
+            {
+                Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)this.SwigCPtr, TextLabel.Property.FontSizeScale, property);
+            }
+#endif
+            RequestLayout();
+        }
+
         /// <summary>
         /// The EnableFontSizeScale property.<br />
         /// Whether the font size scale is enabled. (The default value is true)
@@ -1555,7 +1581,7 @@ namespace Tizen.NUI.BaseComponents
         private void SystemSettingsFontSizeChanged(object sender, FontSizeChangedEventArgs e)
         {
             float newFontSizeScale = TextUtils.GetFontSizeScale(e.Value);
-            SetValue(FontSizeScaleProperty, newFontSizeScale);
+            SetInternalFontSizeScale(newFontSizeScale);
         }
 
         private void addFontSizeChangedCallback()
index 8d1cb7e..adbeb6a 100755 (executable)
@@ -856,28 +856,13 @@ namespace Tizen.NUI.BaseComponents
             var textLabel = (TextLabel)bindable;
             if (newValue != null)
             {
-#if NUI_PROPERTY_CHANGE_2
-                Object.InternalSetPropertyFloat(textLabel.SwigCPtr, TextLabel.Property.FontSizeScale, (float)newValue);
-                textLabel.RequestLayout();
-#else
-                using (var property = new Tizen.NUI.PropertyValue((float)newValue))
-                {
-                    Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)textLabel.SwigCPtr, TextLabel.Property.FontSizeScale, property);
-                    textLabel.RequestLayout();
-                }
-#endif                
+                textLabel.InternalFontSizeScale = (float)newValue;
             }
         }),
         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
         {
             var textLabel = (TextLabel)bindable;
-#if NUI_PROPERTY_CHANGE_2
-            return Object.InternalGetPropertyFloat(textLabel.SwigCPtr, TextLabel.Property.FontSizeScale);
-#else
-            float temp;
-            Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)textLabel.SwigCPtr, TextLabel.Property.FontSizeScale).Get(out temp);
-            return temp;
-#endif
+            return textLabel.InternalFontSizeScale;
         }));
 
         [EditorBrowsable(EditorBrowsableState.Never)]
index 6a87fd7..2626baf 100644 (file)
@@ -45,6 +45,7 @@ namespace Tizen.NUI
                 AutoScrollLoopCount = 2,
                 AutoScrollGap = 50.0f,
                 AutoScrollSpeed = 80,
+                FontSizeScale = Tizen.NUI.FontSizeScale.UseSystemSetting,
             });
 
             // TextField style.
@@ -58,6 +59,7 @@ namespace Tizen.NUI
                 PrimaryCursorColor = new Vector4(0.04f, 0.05f, 0.13f, 1),
                 SecondaryCursorColor = new Vector4(0.04f, 0.05f, 0.13f, 1),
                 CursorWidth = 2,
+                FontSizeScale = Tizen.NUI.FontSizeScale.UseSystemSetting,
                 SelectionHighlightColor = new Vector4(1.00f, 0.38f, 0.00f, 0.30f),
                 GrabHandleColor = new Color(1.00f, 1.00f, 1.00f, 1),
                 GrabHandleImage = FrameworkInformation.ResourcePath + "IoT_handler_center_downW.png",
@@ -94,6 +96,7 @@ namespace Tizen.NUI
                 PrimaryCursorColor = new Vector4(0.04f, 0.05f, 0.13f, 1),
                 SecondaryCursorColor = new Vector4(0.04f, 0.05f, 0.13f, 1),
                 CursorWidth = 2,
+                FontSizeScale = Tizen.NUI.FontSizeScale.UseSystemSetting,
                 SelectionHighlightColor = new Vector4(1.00f, 0.38f, 0.00f, 0.30f),
                 GrabHandleColor = new Color(1.00f, 1.00f, 1.00f, 1),
                 GrabHandleImage = FrameworkInformation.ResourcePath + "IoT_handler_center_downW.png",