* Related patch : https://review.tizen.org/gerrit/#/c/platform/core/uifw/dali-toolkit/+/305104/
* Related patch : https://review.tizen.org/gerrit/#/c/platform/core/uifw/dali-csharp-binder/+/305105/
Since tizen 7.0, DALI StyleManager is disabled by default.
But to support fhub properly, it's needed to provide a way to enable it.
* View/ImageView/Control are created with custom flag `DisableStyleChangeSignals` only when StyleManager is disabled (default)
* Text objects does not process font scale in NUI side when DALI StyleManager is enabled.
Signed-off-by: Jiyun Yang <ji.yang@samsung.com>
public static View New()
{
- View ret = new View(Interop.ViewImpl.New(), true);
+ View ret = new View(Interop.ViewImpl.New((int)View.GetDefaultViewBehaviour()), true);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
base.Dispose(type);
}
- public ViewWrapperImpl(CustomViewBehaviour behaviourFlags) : this(Interop.ViewWrapperImpl.NewViewWrapperImpl((int)behaviourFlags), true)
+ public ViewWrapperImpl(CustomViewBehaviour behaviourFlags) : this(Interop.ViewWrapperImpl.NewViewWrapperImpl((int)(behaviourFlags | View.GetDefaultViewBehaviour())), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
DirectorConnect();
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ImageView_New__SWIG_0")]
public static extern global::System.IntPtr New();
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ImageView_New__SWIG_0_With_Behaviour")]
+ public static extern global::System.IntPtr New(int behaviour);
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ImageView_New__SWIG_1")]
public static extern global::System.IntPtr New(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ImageView_New__SWIG_2")]
public static extern global::System.IntPtr New(string jarg1);
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ImageView_New__SWIG_2_With_Behaviour")]
+ public static extern global::System.IntPtr New(int behaviour, string jarg1);
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ImageView_New__SWIG_3")]
public static extern global::System.IntPtr New(string jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
{
internal static partial class StyleManager
{
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_StyleManager_Enabled")]
+ public static extern void SetEnabled(bool value);
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_StyleManager")]
public static extern global::System.IntPtr NewStyleManager();
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_View_New")]
public static extern global::System.IntPtr New();
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_View_New_With_Behaviour")]
+ public static extern global::System.IntPtr New(int behaviour);
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_View_NewCustom")]
public static extern global::System.IntPtr NewCustom();
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_View_NewCustom_With_Behaviour")]
+ public static extern global::System.IntPtr NewCustom(int behaviour);
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_View__SWIG_0")]
public static extern global::System.IntPtr NewView();
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ViewImpl_New")]
public static extern global::System.IntPtr New();
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ViewImpl_New_With_Behaviour")]
+ public static extern global::System.IntPtr New(int behaviour);
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ViewImpl_SetStyleName")]
public static extern void SetStyleName(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2);
/// Creates an initialized ImageView.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- public ImageView() : this(Interop.ImageView.New(), true)
+ public ImageView() : this(Interop.ImageView.New((int)GetDefaultViewBehaviour()), 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 ImageView(ViewStyle viewStyle) : this(Interop.ImageView.New(), true, viewStyle)
+ public ImageView(ViewStyle viewStyle) : this(Interop.ImageView.New((int)GetDefaultViewBehaviour()), true, viewStyle)
{
}
/// <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 ImageView(bool shown) : this(Interop.ImageView.New(), true)
+ public ImageView(bool shown) : this(Interop.ImageView.New((int)GetDefaultViewBehaviour()), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
SetVisible(shown);
/// </summary>
/// <param name="url">The URL of the image resource to display.</param>
/// <since_tizen> 3 </since_tizen>
- public ImageView(string url) : this(Interop.ImageView.New(url), true)
+ public ImageView(string url) : this(Interop.ImageView.New((int)GetDefaultViewBehaviour(), url), true)
{
ResourceUrl = url;
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
/// <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 ImageView(string url, bool shown) : this(Interop.ImageView.New(url), true)
+ public ImageView(string url, bool shown) : this(Interop.ImageView.New((int)GetDefaultViewBehaviour(), url), true)
{
ResourceUrl = url;
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
/// <since_tizen> 3 </since_tizen>
public partial class TextEditor : View
{
- static private string defaultStyleName = "Tizen.NUI.BaseComponents.TextEditor";
static private string defaultFontFamily = "TizenSans";
private static SystemFontTypeChanged systemFontTypeChanged = new SystemFontTypeChanged();
private static SystemLocaleLanguageChanged systemLocaleLanguageChanged = new SystemLocaleLanguageChanged();
/// Creates the TextEditor control.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- public TextEditor() : this(Interop.TextEditor.New(ThemeManager.GetStyle(defaultStyleName) == null ? false : true), true)
+ public TextEditor() : this(Interop.TextEditor.New(HasStyle()), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// Creates the TextEditor with specified style.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
- public TextEditor(TextEditorStyle style) : this(Interop.TextEditor.New(ThemeManager.GetStyle(defaultStyleName) == null ? false : true), true, style: style)
+ public TextEditor(TextEditorStyle style) : this(Interop.TextEditor.New(HasStyle()), true, style: style)
{
}
/// <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(ThemeManager.GetStyle(defaultStyleName) == null ? false : true), true)
+ public TextEditor(bool shown) : this(Interop.TextEditor.New(HasStyle()), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
SetVisible(shown);
TextChanged += TextEditorTextChanged;
}
- private bool HasStyle()
+ private static bool HasStyle()
{
- return ThemeManager.GetStyle(this.GetType()) == null ? false : true;
+ return (!StyleManager.Enabled && ThemeManager.GetStyle(typeof(TextEditor)) != null);
}
/// <summary>
if (fontSizeScale == value) return;
fontSizeScale = value;
+
+ if (StyleManager.Enabled && fontSizeScale == Tizen.NUI.FontSizeScale.UseSystemSetting)
+ {
+ fontSizeScale = 1;
+ }
+
if (fontSizeScale == Tizen.NUI.FontSizeScale.UseSystemSetting)
{
SystemSettingsFontSize systemSettingsFontSize;
/// <since_tizen> 3 </since_tizen>
public partial class TextField : View
{
- static private string defaultStyleName = "Tizen.NUI.BaseComponents.TextField";
static private string defaultFontFamily = "TizenSans";
private static SystemFontTypeChanged systemFontTypeChanged = new SystemFontTypeChanged();
private static SystemLocaleLanguageChanged systemLocaleLanguageChanged = new SystemLocaleLanguageChanged();
/// Creates the TextField control.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- public TextField() : this(Interop.TextField.New(ThemeManager.GetStyle(defaultStyleName) == null ? false : true), true)
+ public TextField() : this(Interop.TextField.New(HasStyle()), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <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(ThemeManager.GetStyle(defaultStyleName) == null ? false : true), true)
+ public TextField(bool shown) : this(Interop.TextField.New(HasStyle()), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
SetVisible(shown);
ExceedPolicyClip
}
- private bool HasStyle()
+ private static bool HasStyle()
{
- return ThemeManager.GetStyle(this.GetType()) == null ? false : true;
+ return (!StyleManager.Enabled && ThemeManager.GetStyle(typeof(TextField)) != null);
}
/// <summary>
if (fontSizeScale == value) return;
fontSizeScale = value;
+
+ if (StyleManager.Enabled && fontSizeScale == Tizen.NUI.FontSizeScale.UseSystemSetting)
+ {
+ fontSizeScale = 1;
+ }
+
if (fontSizeScale == Tizen.NUI.FontSizeScale.UseSystemSetting)
{
SystemSettingsFontSize systemSettingsFontSize;
private static SystemFontTypeChanged systemFontTypeChanged = new SystemFontTypeChanged();
private static SystemLocaleLanguageChanged systemLocaleLanguageChanged = new SystemLocaleLanguageChanged();
- static private string defaultStyleName = "Tizen.NUI.BaseComponents.TextLabel";
static private string defaultFontFamily = "BreezeSans";
private string textLabelSid = null;
private TextLabelSelectorData selectorData;
/// Creates the TextLabel control.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- public TextLabel() : this(Interop.TextLabel.New(ThemeManager.GetStyle(defaultStyleName) == null ? false : true), true)
+ public TextLabel() : this(Interop.TextLabel.New(HasStyle()), 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(ThemeManager.GetStyle(defaultStyleName) == null ? false : true), true, viewStyle)
+ public TextLabel(TextLabelStyle viewStyle) : this(Interop.TextLabel.New(HasStyle()), true, viewStyle)
{
}
/// <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(ThemeManager.GetStyle(defaultStyleName) == null ? false : true), true)
+ public TextLabel(bool shown) : this(Interop.TextLabel.New(HasStyle()), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
SetVisible(shown);
/// </summary>
/// <param name="text">The text to display</param>
/// <since_tizen> 3 </since_tizen>
- public TextLabel(string text) : this(Interop.TextLabel.New(text, ThemeManager.GetStyle(defaultStyleName) == null ? false : true), true)
+ public TextLabel(string text) : this(Interop.TextLabel.New(text, HasStyle()), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <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, ThemeManager.GetStyle(defaultStyleName) == null ? false : true), true)
+ public TextLabel(string text, bool shown) : this(Interop.TextLabel.New(text, HasStyle()), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
SetVisible(shown);
}
}
- private bool HasStyle()
+ private static bool HasStyle()
{
- return ThemeManager.GetStyle(this.GetType()) == null ? false : true;
+ bool ret = (!StyleManager.Enabled && ThemeManager.GetStyle(typeof(TextLabel)) != null);
+ return ret;
}
/// <summary>
if (fontSizeScale == value) return;
fontSizeScale = value;
+
+ if (StyleManager.Enabled && fontSizeScale == Tizen.NUI.FontSizeScale.UseSystemSetting)
+ {
+ fontSizeScale = 1;
+ }
+
if (fontSizeScale == Tizen.NUI.FontSizeScale.UseSystemSetting)
{
SystemSettingsFontSize systemSettingsFontSize;
{
case ViewAccessibilityMode.Custom:
{
- return Interop.View.NewCustom();
+ return Interop.View.NewCustom((int)GetDefaultViewBehaviour());
}
case ViewAccessibilityMode.Default:
default:
{
- return Interop.View.New();
+ return Interop.View.New((int)GetDefaultViewBehaviour());
}
}
}
/// 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 View(ViewStyle viewStyle) : this(Interop.View.New(), true, viewStyle)
+ public View(ViewStyle viewStyle) : this(Interop.View.New((int)GetDefaultViewBehaviour()), true, viewStyle)
{
}
/// <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 View(bool shown) : this(Interop.View.New(), true)
+ public View(bool shown) : this(Interop.View.New((int)GetDefaultViewBehaviour()), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
SetVisible(shown);
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
}
+ internal static CustomViewBehaviour GetDefaultViewBehaviour()
+ {
+ return StyleManager.Enabled ? CustomViewBehaviour.ViewBehaviourDefault : CustomViewBehaviour.DisableStyleChangeSignals;
+ }
+
internal bool IsTopLevelView()
{
if (GetParent() is Layer)
}
}
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static bool Enabled
+ {
+ get;
+ set;
+ } = false;
+
/// <summary>
/// Gets the singleton of StyleManager object.
/// </summary>