From 5cd9ab1cfc5cffefc9dc97c91876e49f65a2e298 Mon Sep 17 00:00:00 2001 From: WenJY Date: Thu, 11 Jun 2026 23:30:22 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20=E4=BF=AE=E6=94=B9=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E6=98=BE=E7=A4=BA=EF=BC=9A=E9=85=8D=E7=BD=AE=E6=B7=B1?= =?UTF-8?q?=E8=89=B2=E3=80=81=E6=B5=85=E8=89=B2=E4=B8=BB=E9=A2=98=E5=88=87?= =?UTF-8?q?=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sln.Wcs.UI/App.axaml | 81 +++++++ Sln.Wcs.UI/Views/Base/EntityEditWindow.axaml | 32 +-- .../Views/Base/EntityEditWindow.axaml.cs | 20 +- .../Views/Base/LocationInfoListView.axaml | 62 +++--- .../Views/Base/MaterialInfoListView.axaml | 46 ++-- Sln.Wcs.UI/Views/Base/StoreInfoListView.axaml | 34 +-- .../Views/Device/DeviceHostListView.axaml | 46 ++-- .../Views/Device/DeviceInfoListView.axaml | 119 ++++++----- .../Views/Device/DeviceParamListView.axaml | 54 ++--- Sln.Wcs.UI/Views/HomePageView.axaml | 200 ++++++++---------- Sln.Wcs.UI/Views/MainWindow.axaml | 95 +++++---- Sln.Wcs.UI/Views/MainWindow.axaml.cs | 58 +++-- .../Views/Path/PathDetailsListView.axaml | 42 ++-- Sln.Wcs.UI/Views/Path/PathInfoListView.axaml | 103 ++++----- Sln.Wcs.UI/Views/SystemMonitorView.axaml | 14 +- .../Views/Task/TaskDetailListView.axaml | 66 +++--- Sln.Wcs.UI/Views/Task/TaskQueueListView.axaml | 123 +++++------ 17 files changed, 644 insertions(+), 551 deletions(-) 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"> - -