Skip to content

Commit

Permalink
[NUI] Add IsUsingXaml to RemoveFrontInset and RemoveBackInset (Samsun…
Browse files Browse the repository at this point in the history
  • Loading branch information
dongsug-song authored and bshsqa committed May 13, 2024
1 parent 0bb3110 commit dc6260d
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 20 deletions.
56 changes: 44 additions & 12 deletions src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ public partial class TextEditor : View
private Color internalGrabHandleColor = null;


static TextEditor()
{
if(NUIApplication.IsUsingXaml)
static TextEditor()
{
if (NUIApplication.IsUsingXaml)
{
TextProperty = BindableProperty.Create(nameof(Text), typeof(string), typeof(TextEditor), string.Empty, propertyChanged: SetInternalTextProperty, defaultValueCreator: GetInternalTextProperty);

Expand Down Expand Up @@ -202,6 +202,10 @@ static TextEditor()
PrimaryCursorPositionProperty = BindableProperty.Create(nameof(PrimaryCursorPosition), typeof(int), typeof(Tizen.NUI.BaseComponents.TextEditor), 0, propertyChanged: SetInternalPrimaryCursorPositionProperty, defaultValueCreator: GetInternalPrimaryCursorPositionProperty);

CharacterSpacingProperty = BindableProperty.Create(nameof(CharacterSpacing), typeof(float), typeof(TextEditor), default(float), propertyChanged: SetInternalCharacterSpacingProperty, defaultValueCreator: GetInternalCharacterSpacingProperty);

RemoveFrontInsetProperty = BindableProperty.Create(nameof(RemoveFrontInset), typeof(bool), typeof(TextEditor), false, propertyChanged: SetInternalRemoveFrontInsetProperty, defaultValueCreator: GetInternalRemoveFrontInsetProperty);

RemoveBackInsetProperty = BindableProperty.Create(nameof(RemoveBackInset), typeof(bool), typeof(TextEditor), false, propertyChanged: SetInternalRemoveBackInsetProperty, defaultValueCreator: GetInternalRemoveBackInsetProperty);
}
}

Expand Down Expand Up @@ -1098,7 +1102,7 @@ public PropertyMap SelectionHandleImageRight
if (NUIApplication.IsUsingXaml)
{
return (PropertyMap)GetValue(SelectionHandleImageRightProperty);

}
else
{
Expand All @@ -1110,7 +1114,7 @@ public PropertyMap SelectionHandleImageRight
if (NUIApplication.IsUsingXaml)
{
SetValue(SelectionHandleImageRightProperty, value);

}
else
{
Expand Down Expand Up @@ -2830,7 +2834,7 @@ public Color GrabHandleColor
}
else
{
SetInternalGrabHandleColorProperty(this, null, value);
SetInternalGrabHandleColorProperty(this, null, value);
}
NotifyPropertyChanged();
}
Expand Down Expand Up @@ -3103,7 +3107,7 @@ public bool Ellipsis
if (NUIApplication.IsUsingXaml)
{
return (bool)GetValue(EllipsisProperty);

}
else
{
Expand Down Expand Up @@ -3664,11 +3668,25 @@ public bool RemoveFrontInset
{
get
{
return (bool)GetValue(RemoveFrontInsetProperty);
if (NUIApplication.IsUsingXaml)
{
return (bool)GetValue(RemoveFrontInsetProperty);
}
else
{
return (bool)GetInternalRemoveFrontInsetProperty(this);
}
}
set
{
SetValue(RemoveFrontInsetProperty, value);
if (NUIApplication.IsUsingXaml)
{
SetValue(RemoveFrontInsetProperty, value);
}
else
{
SetInternalRemoveFrontInsetProperty(this, null, value);
}
NotifyPropertyChanged();
}
}
Expand All @@ -3685,11 +3703,25 @@ public bool RemoveBackInset
{
get
{
return (bool)GetValue(RemoveBackInsetProperty);
if (NUIApplication.IsUsingXaml)
{
return (bool)GetValue(RemoveBackInsetProperty);
}
else
{
return (bool)GetInternalRemoveBackInsetProperty(this);
}
}
set
{
SetValue(RemoveBackInsetProperty, value);
if (NUIApplication.IsUsingXaml)
{
SetValue(RemoveBackInsetProperty, value);
}
else
{
SetInternalRemoveBackInsetProperty(this, null, value);
}
NotifyPropertyChanged();
}
}
Expand Down Expand Up @@ -3876,7 +3908,7 @@ private void AddSystemSettingsFontTypeChanged()
}
}
}

private void RemoveSystemSettingsFontTypeChanged()
{
if (hasSystemFontTypeChanged)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1576,36 +1576,38 @@ internal static object GetInternalCharacterSpacingProperty(BindableObject bindab
/// RemoveFrontInsetProperty
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public static readonly BindableProperty RemoveFrontInsetProperty = BindableProperty.Create(nameof(RemoveFrontInset), typeof(bool), typeof(TextLabel), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
public static readonly BindableProperty RemoveFrontInsetProperty = null;
internal static void SetInternalRemoveFrontInsetProperty(BindableObject bindable, object oldValue, object newValue)
{
var textEditor = (TextEditor)bindable;
if (newValue != null)
{
Object.InternalSetPropertyBool(textEditor.SwigCPtr, TextEditor.Property.RemoveFrontInset, (bool)newValue);
}
}),
defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
}
internal static object GetInternalRemoveFrontInsetProperty(BindableObject bindable)
{
var textEditor = (TextEditor)bindable;
return Object.InternalGetPropertyBool(textEditor.SwigCPtr, TextEditor.Property.RemoveFrontInset);
}));
}

/// <summary>
/// RemoveBackInsetProperty
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public static readonly BindableProperty RemoveBackInsetProperty = BindableProperty.Create(nameof(RemoveBackInset), typeof(bool), typeof(TextLabel), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
public static readonly BindableProperty RemoveBackInsetProperty = null;
internal static void SetInternalRemoveBackInsetProperty(BindableObject bindable, object oldValue, object newValue)
{
var textEditor = (TextEditor)bindable;
if (newValue != null)
{
Object.InternalSetPropertyBool(textEditor.SwigCPtr, TextEditor.Property.RemoveBackInset, (bool)newValue);
}
}),
defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
}
internal static object GetInternalRemoveBackInsetProperty(BindableObject bindable)
{
var textEditor = (TextEditor)bindable;
return Object.InternalGetPropertyBool(textEditor.SwigCPtr, TextEditor.Property.RemoveBackInset);
}));
}
}
}

0 comments on commit dc6260d

Please sign in to comment.