diff --git a/Sln.Wcs.UI/App.axaml b/Sln.Wcs.UI/App.axaml index 783f573..ce86296 100644 --- a/Sln.Wcs.UI/App.axaml +++ b/Sln.Wcs.UI/App.axaml @@ -7,7 +7,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #2E5A7A + #1E3A5A + #3E6A9A + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #8FA0B0 + #6F8292 + #AFBECC + + + + + + diff --git a/Sln.Wcs.UI/Views/Base/EntityEditWindow.axaml b/Sln.Wcs.UI/Views/Base/EntityEditWindow.axaml index 5b8ce7e..4978734 100644 --- a/Sln.Wcs.UI/Views/Base/EntityEditWindow.axaml +++ b/Sln.Wcs.UI/Views/Base/EntityEditWindow.axaml @@ -13,16 +13,16 @@ SystemDecorations="Full" CanResize="False"> - + + Background="{DynamicResource CardBgBrush}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,0,0,1"> - - + + @@ -33,29 +33,17 @@ + Background="{DynamicResource PageBgBrush}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,1,0,0"> + Background="{DynamicResource PrimaryBtnBrush}" Foreground="White" + CornerRadius="4" /> diff --git a/Sln.Wcs.UI/Views/Base/EntityEditWindow.axaml.cs b/Sln.Wcs.UI/Views/Base/EntityEditWindow.axaml.cs index c023b6c..4495595 100644 --- a/Sln.Wcs.UI/Views/Base/EntityEditWindow.axaml.cs +++ b/Sln.Wcs.UI/Views/Base/EntityEditWindow.axaml.cs @@ -5,6 +5,7 @@ using Avalonia; using Avalonia.Controls; using Avalonia.Layout; using Avalonia.Media; +using Avalonia.Styling; using Sln.Wcs.UI.ViewModels.Base; namespace Sln.Wcs.UI.Views.Base; @@ -31,12 +32,21 @@ public partial class EntityEditWindow : Window return _tcs.Task; } + private static bool IsDark => + Application.Current!.ActualThemeVariant == ThemeVariant.Dark; + private void BuildForm(List fields) { FormPanel.Children.Clear(); if (_entity is null) return; var type = _entity.GetType(); + var labelFg = Brush.Parse(IsDark ? "#8B9BB5" : "#656D76"); + var checkFg = Brush.Parse(IsDark ? "#BCC8D6" : "#1F2328"); + var tbBg = Brush.Parse(IsDark ? "#0A0E14" : "#F0F2F5"); + var tbFg = Brush.Parse(IsDark ? "#DDE4F0" : "#1F2328"); + var tbBorder = Brush.Parse(IsDark ? "#1A2F4A" : "#D0D7DE"); + foreach (var field in fields) { var prop = type.GetProperty(field.PropertyName); @@ -58,7 +68,7 @@ public partial class EntityEditWindow : Window { Text = field.DisplayName, FontSize = 12, - Foreground = Brush.Parse("#7B8FA8"), + Foreground = labelFg, VerticalAlignment = VerticalAlignment.Center, }; row.Children.Add(label); @@ -71,7 +81,7 @@ public partial class EntityEditWindow : Window { IsChecked = value is int iv ? iv == 1 : (value as bool? ?? false), IsEnabled = !field.IsReadOnly, - Foreground = Brush.Parse("#BCC8D6"), + Foreground = checkFg, VerticalAlignment = VerticalAlignment.Center, }; cb.IsCheckedChanged += (_, _) => @@ -85,9 +95,9 @@ public partial class EntityEditWindow : Window Text = value?.ToString() ?? "", IsReadOnly = field.IsReadOnly, Watermark = field.DisplayName, - Background = Brush.Parse("#0A0E14"), - Foreground = Brush.Parse("#DDE4F0"), - BorderBrush = Brush.Parse("#1A2F4A"), + Background = tbBg, + Foreground = tbFg, + BorderBrush = tbBorder, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(3), Padding = new Thickness(8, 5), diff --git a/Sln.Wcs.UI/Views/Base/LocationInfoListView.axaml b/Sln.Wcs.UI/Views/Base/LocationInfoListView.axaml index ba10bed..91fa5ec 100644 --- a/Sln.Wcs.UI/Views/Base/LocationInfoListView.axaml +++ b/Sln.Wcs.UI/Views/Base/LocationInfoListView.axaml @@ -3,45 +3,45 @@ x:Class="Sln.Wcs.UI.Views.Base.LocationInfoListView"> - -