add dark theme color at custom window border
authorMarcin Romaniuk <m.romaniuk@samsung.com>
Mon, 3 Apr 2023 10:28:58 +0000 (12:28 +0200)
committerMarcin Romaniuk/Tizen Services & IoT (PLT) /SRPOL/Senior Designer/Samsung Electronics <m.romaniuk@samsung.com>
Mon, 3 Apr 2023 12:19:47 +0000 (14:19 +0200)
SettingView/SettingViewBorder.cs

index 1c56c9f4962ae577daeb15bf9951c9711684f8e2..b086d7c48687a9737030414b19c1f1fbbe20b399 100644 (file)
@@ -29,7 +29,8 @@ namespace SettingView
 
         public static readonly float WindowCornerRadius = 26.0f;
 
-        private static readonly Color mBackgroundColor = Color.White.WithAlpha(0.35f);
+        private bool IsLightTheme => ThemeManager.PlatformThemeId == "org.tizen.default-light-theme";
+        private Color mBackgroundColor => IsLightTheme ? Color.White.WithAlpha(0.35f) : new Color("#161319").WithAlpha(0.5f);
 
         private static string GetResourcePath(string relativePath) => System.IO.Path.Combine(Tizen.Applications.Application.Current.DirectoryInfo.Resource, relativePath);
         private static string MinimalizeIconPath = GetResourcePath("window-border/window-minimalize.svg");
@@ -49,6 +50,18 @@ namespace SettingView
         {
             ResizePolicy = Window.BorderResizePolicyType.Free;
             MinSize = new Size2D(500, 300);
+
+            ThemeManager.ThemeChanged += ThemeManager_ThemeChanged;
+        }
+
+        private void ThemeManager_ThemeChanged(object sender, ThemeChangedEventArgs e)
+        {
+            if (borderView == null)
+            {
+                return;
+            }
+
+            borderView.BackgroundColor = mBackgroundColor;
         }
 
         public override bool CreateBottomBorderView(View bottomView)