fix main menu item margins and icon colors
authorMarcin Romaniuk <m.romaniuk@samsung.com>
Fri, 31 Mar 2023 13:36:24 +0000 (15:36 +0200)
committerMarcin Romaniuk/Tizen Services & IoT (PLT) /SRPOL/Senior Designer/Samsung Electronics <m.romaniuk@samsung.com>
Mon, 3 Apr 2023 12:19:27 +0000 (14:19 +0200)
SettingCore/MenuGadget.cs
SettingCore/Views/MainMenuItem.cs
SettingMainGadget/AboutGadget.cs
SettingMainGadget/DateTimeGadget.cs
SettingMainGadget/DisplayGadget.cs
SettingMainGadget/LanguageInputGadget.cs
SettingMainGadget/Sound/SoundGadget.cs
SettingView/SettingView.cs

index 772bba5c23b208003a68a06a14bba4cc7621e572..52a2556b7e835f33640027e4f2fe2e489bb8cc56 100644 (file)
@@ -62,6 +62,8 @@ namespace SettingCore
         protected void NavigateBack() => GadgetNavigation.NavigateBack();
         protected void NavigateTo(string menuPath) => GadgetNavigation.NavigateTo(menuPath);
 
+        protected bool IsLightTheme => ThemeManager.PlatformThemeId == "org.tizen.default-light-theme";
+
         protected string GetResourcePath(string relativeFilePath)
         {
             string callingAssemblyName = System.Reflection.Assembly.GetCallingAssembly().GetName().Name;
index 46f23a58309e661b5250f14395b89f5c627f5fe6..ae8b74741e130d77bdbd9affc431b8319145bf7b 100644 (file)
@@ -6,7 +6,7 @@ namespace SettingCore.Views
     public class MainMenuItem : BaseComponent
     {
         private readonly ThemeColor BackgroundColors = new ThemeColor(Color.Transparent, Color.Transparent, new Color("#FF6400").WithAlpha(0.16f), Color.White.WithAlpha(0.16f));
-        private readonly ThemeColor TextColors = new ThemeColor(new Color("#090E21"), new Color("#CACACA"), new Color("#FF6200"), new Color("#FF8A00"));
+        private readonly ThemeColor TextColors = new ThemeColor(new Color("#090E21"), new Color("#FDFDFD"), new Color("#FF6200"), new Color("#FF8A00"));
         private readonly ThemeColor IconColors = new ThemeColor(Color.White, Color.Black, Color.White, Color.Black);
         private readonly ThemeColor IconBackgroundColors;
 
@@ -51,6 +51,7 @@ namespace SettingCore.Views
                 Text = title,
                 PixelSize = 24.SpToPx(),
                 TextColor = TextColors.Normal,
+                Margin = new Extents(16, 16, 16, 16).SpToPx(),
             };
             FlexLayout.SetFlexGrow(titleTextLabel, 1);
 
index 222ef1d3238e858cbb4f01e6e4f2d371c261e435..7dde133cebe657e4eb9a88e1545fa7b505c1eb6d 100644 (file)
@@ -28,7 +28,7 @@ namespace Setting.Menu
         private string deviceName;
         private bool isLightTheme => ThemeManager.PlatformThemeId == "org.tizen.default-light-theme";
 
-        public override Color ProvideIconColor() => new Color("#301A4B");
+        public override Color ProvideIconColor() => new Color(IsLightTheme ? "#301A4B" : "#CAB4E5");
 
         public override string ProvideIconPath() => GetResourcePath("about.svg");
 
index 7867c7f803af94cea7326dd167c6bfe289c909ee..43c3cb639187d007359284067aabbf94d2f0a8bb 100644 (file)
@@ -14,7 +14,7 @@ namespace Setting.Menu
 {
     public class DateTimeGadget : SettingCore.MainMenuGadget
     {
-        public override Color ProvideIconColor() => new Color("#205493");
+        public override Color ProvideIconColor() => new Color(IsLightTheme ? "#205493" : "#2560A8");
 
         public override string ProvideIconPath() => GetResourcePath("datetime.svg");
 
index 860719af5fb818f5daded3feace1f00a6e6bd07b..9eca6fdb38b5c10d30ee72c6848a1150aded2661 100644 (file)
@@ -16,7 +16,7 @@ namespace Setting.Menu
 {
     public class DisplayGadget : SettingCore.MainMenuGadget
     {
-        public override Color ProvideIconColor() => new Color("#0075FF");
+        public override Color ProvideIconColor() => new Color(IsLightTheme ? "#0075FF" : "#1A85FF");
 
         public override string ProvideIconPath() => GetResourcePath("display.svg");
 
index 76da06f6dec8fde363780d041c0a294b3d0bc6af..17f1a842d9270db24f7dab66b563f5b263531d6c 100644 (file)
@@ -16,7 +16,7 @@ namespace Setting.Menu
 {
     public class LanguageInputGadget : SettingCore.MainMenuGadget
     {
-        public override Color ProvideIconColor() => new Color("#205493");
+        public override Color ProvideIconColor() => new Color(IsLightTheme ? "#205493" : "#2560A8");
 
         public override string ProvideIconPath() => GetResourcePath("language_input.svg");
 
index eb29f89229c3aaa60c1a6f63755d89a3327b386a..7719ef963f6de87d4f15a0108ca488545fcfd072 100644 (file)
@@ -22,7 +22,7 @@ namespace Setting.Menu
         private TextListItem soundMode;
         private TextListItem notificationSound;
 
-        public override Color ProvideIconColor() => new Color("#DB3069");
+        public override Color ProvideIconColor() => new Color(IsLightTheme  ? "#DB3069" : "#DF4679");
 
         public override string ProvideIconPath() => GetResourcePath("sound.svg");
 
index 3a70e7477af2705550e3562480831b4f20685a44..ae72d29bf8a0f62f93f6d6c040cb9dc09596d13f 100644 (file)
@@ -54,6 +54,7 @@ namespace SettingView
             GetDefaultWindow().GetDefaultNavigator().Push(mMainPage);
 
             Tizen.System.SystemSettings.LocaleLanguageChanged += SystemSettings_LocaleLanguageChanged;
+            ThemeManager.ThemeChanged += ThemeManager_ThemeChanged;
             GadgetManager.Instance.CustomizationChanged += CustomizationChanged;
 
             LogScalableInfo();
@@ -143,6 +144,15 @@ namespace SettingView
             }
         }
 
+        private void ThemeManager_ThemeChanged(object sender, ThemeChangedEventArgs e)
+        {
+            if (mMainPage != null)
+            {
+                // recreate main page content just to apply new colors from gadgets
+                mMainPage.Content = CreateContent();
+            }
+        }
+
         private static AppBar CreateAppBar()
         {
             // TODO: remove style customization with scalable unit, when merged to TizenFX