From 0cb6ea66034b3a9de927384315026d6384c54fe0 Mon Sep 17 00:00:00 2001 From: huayongxu <49056704+huayongxu@users.noreply.github.com> Date: Tue, 7 Jul 2020 14:09:41 +0800 Subject: [PATCH] [NUI] Fix the issue that theme could not be changed (#1801) * Fix the issue that theme could not be changed * change default theme from lower to upper --- src/Tizen.NUI.Components/Utils/StyleManager.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Tizen.NUI.Components/Utils/StyleManager.cs b/src/Tizen.NUI.Components/Utils/StyleManager.cs index 40d3e68..2535256 100755 --- a/src/Tizen.NUI.Components/Utils/StyleManager.cs +++ b/src/Tizen.NUI.Components/Utils/StyleManager.cs @@ -30,8 +30,8 @@ namespace Tizen.NUI.Components internal const float PointSizeNormal = 12; internal const float PointSizeTitle = 16; - private const string defaultThemeName = "default"; - private const string wearableThemeName = "wearable"; + private const string defaultThemeName = "DEFAULT"; //"default"; + private const string wearableThemeName = "WEARABLE"; //"wearable"; private string currentThemeName = defaultThemeName; private Dictionary> themeStyleSet = new Dictionary>(); @@ -94,9 +94,9 @@ namespace Tizen.NUI.Components set { - if (currentThemeName != value) + if (value != null && currentThemeName != value) { - currentThemeName = value.ToLower(); + currentThemeName = value.ToUpperInvariant(); themeChangeHander?.Invoke(null, new ThemeChangeEventArgs { CurrentTheme = currentThemeName }); UpdateTheme(); @@ -132,6 +132,8 @@ namespace Tizen.NUI.Components return; } + theme = theme.ToUpperInvariant(); + if (themeStyleSet.ContainsKey(style) && themeStyleSet[style].ContainsKey(theme)) { throw new InvalidOperationException($"{style}] already be used"); -- 2.7.4