});
/// 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 PixelSizeProperty = BindableProperty.Create(nameof(PixelSize), typeof(float?), typeof(TextFieldStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ public static readonly BindableProperty PixelSizeSelectorProperty = BindableProperty.Create("PixelSizeSelector", typeof(float?), typeof(TextFieldStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
{
var textFieldStyle = (TextFieldStyle)bindable;
- textFieldStyle.pixelSize = (float?)newValue;
+ textFieldStyle.pixelSizeSelector = ((Selector<float?>)newValue)?.Clone();
},
defaultValueCreator: (bindable) =>
{
var textFieldStyle = (TextFieldStyle)bindable;
- return textFieldStyle.pixelSize;
+ return textFieldStyle.pixelSizeSelector;
});
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
private string emboss;
private string inputEmboss;
private string inputOutline;
- private float? pixelSize;
+ private Selector<float?> pixelSizeSelector;
private bool? enableSelection;
private bool? ellipsis;
private bool? matchSystemLanguageDirection;
/// 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 float? PixelSize
+ public Selector<float?> PixelSize
{
- get => (float?)GetValue(PixelSizeProperty);
- set => SetValue(PixelSizeProperty, value);
+ get => (Selector<float?>)GetValue(PixelSizeSelectorProperty) ?? (pixelSizeSelector = new Selector<float?>());
+ set => SetValue(PixelSizeSelectorProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
});
/// 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 PixelSizeProperty = BindableProperty.Create(nameof(PixelSize), typeof(float?), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ public static readonly BindableProperty PixelSizeSelectorProperty = BindableProperty.Create("PixelSizeSelector", typeof(Selector<float?>), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
{
- var textLabelStyle = (TextLabelStyle)bindable;
- textLabelStyle.pixelSize = (float?)newValue;
+ ((TextLabelStyle)bindable).pixelSizeSelector = ((Selector<float?>)newValue)?.Clone();
},
defaultValueCreator: (bindable) =>
{
- var textLabelStyle = (TextLabelStyle)bindable;
- return textLabelStyle.pixelSize;
+ return ((TextLabelStyle)bindable).pixelSizeSelector;
});
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
private float? autoScrollGap;
private float? lineSpacing;
private string emboss;
- private float? pixelSize;
+ private Selector<float?> pixelSizeSelector;
private bool? ellipsis;
private float? autoScrollLoopDelay;
private AutoScrollStopMode? autoScrollStopMode;
/// 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 float? PixelSize
+ public Selector<float?> PixelSize
{
- get => (float?)GetValue(PixelSizeProperty);
- set => SetValue(PixelSizeProperty, value);
+ get => (Selector<float?>)GetValue(PixelSizeSelectorProperty) ?? (pixelSizeSelector = new Selector<float?>());
+ set => SetValue(PixelSizeSelectorProperty, value);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
set
{
SetValue(PixelSizeProperty, value);
+ selectorData?.PixelSize.UpdateIfNeeds(this, value);
NotifyPropertyChanged();
}
}
var textField = (TextField)bindable;
return textField.SelectorData.PointSize.Get(textField);
});
+ internal static readonly BindableProperty PixelSizeSelectorProperty = BindableProperty.Create("PixelSizeSelector", typeof(Selector<float?>), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textField = (TextField)bindable;
+ textField.SelectorData.PixelSize.Update(textField, (Selector<float?>)newValue, true);
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textField = (TextField)bindable;
+ return textField.SelectorData.PixelSize.Get(textField);
+ });
internal static readonly BindableProperty TextColorSelectorProperty = BindableProperty.Create("TextColorSelector", typeof(Selector<Color>), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) =>
{
var textField = (TextField)bindable;
public TriggerableSelector<string> FontFamily { get; } = new TriggerableSelector<string>(TextField.FontFamilyProperty);
public TriggerableSelector<Color> TextColor { get; } = new TriggerableSelector<Color>(TextField.TextColorProperty, GetTextColor);
public TriggerableSelector<float?> PointSize { get; } = new TriggerableSelector<float?>(TextField.PointSizeProperty);
+ public TriggerableSelector<float?> PixelSize { get; } = new TriggerableSelector<float?>(TextField.PixelSizeProperty);
public TriggerableSelector<string> TranslatablePlaceholderText { get; } = new TriggerableSelector<string>(TextField.TranslatablePlaceholderTextProperty);
public TriggerableSelector<Vector4> PlaceholderTextColor { get; } = new TriggerableSelector<Vector4>(TextField.PlaceholderTextColorProperty, delegate (View view)
{
FontFamily.Reset(view);
TextColor.Reset(view);
PointSize.Reset(view);
+ PixelSize.Reset(view);
TranslatablePlaceholderText.Reset(view);
PlaceholderTextColor.Reset(view);
PrimaryCursorColor.Reset(view);
set
{
SetValue(PixelSizeProperty, value);
+ selectorData?.PixelSize.UpdateIfNeeds(this, value);
NotifyPropertyChangedAndRequestLayout();
}
}
var textLabel = (TextLabel)bindable;
return textLabel.SelectorData.TextShadow.Get(textLabel);
});
+
+ internal static readonly BindableProperty PixelSizeSelectorProperty = BindableProperty.Create("PixelSizeSelector", typeof(Selector<float?>), typeof(TextLabel), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textLabel = (TextLabel)bindable;
+ ((TextLabel)bindable).SelectorData.PixelSize.Update(textLabel, (Selector<float?>)newValue, true);
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textLabel = (TextLabel)bindable;
+ return textLabel.SelectorData.PixelSize.Get(textLabel);
+ });
#endregion
}
public TriggerableSelector<string> FontFamily { get; } = new TriggerableSelector<string>(TextLabel.FontFamilyProperty);
public TriggerableSelector<Color> TextColor { get; } = new TriggerableSelector<Color>(TextLabel.TextColorProperty, GetTextColor);
public TriggerableSelector<float?> PointSize { get; } = new TriggerableSelector<float?>(TextLabel.PointSizeProperty);
+ public TriggerableSelector<float?> PixelSize { get; } = new TriggerableSelector<float?>(TextLabel.PixelSizeProperty);
public TriggerableSelector<TextShadow> TextShadow { get; } = new TriggerableSelector<TextShadow>(TextLabel.TextShadowProperty);
public virtual void Reset(View view)
FontFamily.Reset(view);
TextColor.Reset(view);
PointSize.Reset(view);
+ PixelSize.Reset(view);
TextShadow.Reset(view);
}
private void InitializeStyle(ViewStyle style)
{
- if (!ThemeManager.ThemeApplied) return;
-
- if (style == null) UpdateStyle(); // Use style in the current theme
- else ApplyStyle(style.Clone()); // Use given style
+ if (style != null) ApplyStyle(style.Clone()); // Use given style
+ else if (ThemeManager.ThemeApplied) UpdateStyle(); // Use style in the current theme
}
}
}