From 871f112800a1e60b6f851ce1a2e34088f2ea831f Mon Sep 17 00:00:00 2001 From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com> Date: Wed, 15 May 2024 21:40:27 +0800 Subject: [PATCH] fix: fix CalendarDatePicker & ComboBox color. --- .../Pages/CalendarDatePickerDemo.axaml | 25 +++-- .../Pages/ComboBoxDemo.axaml | 97 +++++++------------ .../Pages/ComboBoxDemo.axaml.cs | 10 +- .../Themes/Dark/CalendarDatePicker.axaml | 6 +- src/Semi.Avalonia/Themes/Dark/ComboBox.axaml | 18 ++-- .../Themes/Light/CalendarDatePicker.axaml | 8 +- src/Semi.Avalonia/Themes/Light/ComboBox.axaml | 11 ++- 7 files changed, 84 insertions(+), 91 deletions(-) diff --git a/demo/Semi.Avalonia.Demo/Pages/CalendarDatePickerDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/CalendarDatePickerDemo.axaml index 44a1413..4730e62 100644 --- a/demo/Semi.Avalonia.Demo/Pages/CalendarDatePickerDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/CalendarDatePickerDemo.axaml @@ -8,11 +8,22 @@ d:DesignWidth="800" mc:Ignorable="d"> - - + + + + + + + + + + + + - - + + + - - - - - + \ No newline at end of file diff --git a/demo/Semi.Avalonia.Demo/Pages/ComboBoxDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/ComboBoxDemo.axaml index 488a8ff..1595b4a 100644 --- a/demo/Semi.Avalonia.Demo/Pages/ComboBoxDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/ComboBoxDemo.axaml @@ -4,71 +4,40 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - d:DesignHeight="450" + xmlns:pages="clr-namespace:Semi.Avalonia.Demo.Pages" + d:DesignHeight="800" d:DesignWidth="800" mc:Ignorable="d"> + + + - - Ding - Otter - Husky - Mr. 17 - Cass - - - Ding - Otter - Husky - Mr. 17 - Cass - - - Ding - Otter - Husky - Mr. 17 - Cass - - - Ding - Otter - Husky - Mr. 17 - Cass - - - Ding - Otter - Husky - Mr. 17 - Cass - - - Ding - Otter - Husky - Mr. 17 - Cass - - - Ding - Otter - Husky - Mr. 17 - Cass - - - Ding - Otter - Husky - Mr. 17 - Cass - + + + + + + + + + + + + + + + + + + + + + + + + - + \ No newline at end of file diff --git a/demo/Semi.Avalonia.Demo/Pages/ComboBoxDemo.axaml.cs b/demo/Semi.Avalonia.Demo/Pages/ComboBoxDemo.axaml.cs index 80b05bc..3c8cba2 100644 --- a/demo/Semi.Avalonia.Demo/Pages/ComboBoxDemo.axaml.cs +++ b/demo/Semi.Avalonia.Demo/Pages/ComboBoxDemo.axaml.cs @@ -1,6 +1,6 @@ -using Avalonia; +using System.Collections.ObjectModel; using Avalonia.Controls; -using Avalonia.Markup.Xaml; +using CommunityToolkit.Mvvm.ComponentModel; namespace Semi.Avalonia.Demo.Pages; @@ -9,5 +9,11 @@ public partial class ComboBoxDemo : UserControl public ComboBoxDemo() { InitializeComponent(); + this.DataContext = new ComboBoxDemoViewModel(); } +} + +public class ComboBoxDemoViewModel : ObservableObject +{ + public ObservableCollection Items { get; set; } = ["Ding", "Otter", "Husky", "Mr.17", "Cass"]; } \ No newline at end of file diff --git a/src/Semi.Avalonia/Themes/Dark/CalendarDatePicker.axaml b/src/Semi.Avalonia/Themes/Dark/CalendarDatePicker.axaml index 962d533..817c7e1 100644 --- a/src/Semi.Avalonia/Themes/Dark/CalendarDatePicker.axaml +++ b/src/Semi.Avalonia/Themes/Dark/CalendarDatePicker.axaml @@ -10,7 +10,7 @@ 0 0 8 0 #1AFFFFFF - + - - + + \ No newline at end of file diff --git a/src/Semi.Avalonia/Themes/Dark/ComboBox.axaml b/src/Semi.Avalonia/Themes/Dark/ComboBox.axaml index 29fc605..5d8a707 100644 --- a/src/Semi.Avalonia/Themes/Dark/ComboBox.axaml +++ b/src/Semi.Avalonia/Themes/Dark/ComboBox.axaml @@ -1,27 +1,31 @@ + - + + + 0 0 8 0 #1AFFFFFF - - + + + @@ -30,9 +34,11 @@ - + + + - - + + \ No newline at end of file diff --git a/src/Semi.Avalonia/Themes/Light/CalendarDatePicker.axaml b/src/Semi.Avalonia/Themes/Light/CalendarDatePicker.axaml index fccdc95..19a5b83 100644 --- a/src/Semi.Avalonia/Themes/Light/CalendarDatePicker.axaml +++ b/src/Semi.Avalonia/Themes/Light/CalendarDatePicker.axaml @@ -2,15 +2,15 @@ - - - + + + 0 0 8 0 #1A000000 - + \ No newline at end of file diff --git a/src/Semi.Avalonia/Themes/Light/ComboBox.axaml b/src/Semi.Avalonia/Themes/Light/ComboBox.axaml index 46fe865..8fc128f 100644 --- a/src/Semi.Avalonia/Themes/Light/ComboBox.axaml +++ b/src/Semi.Avalonia/Themes/Light/ComboBox.axaml @@ -1,11 +1,13 @@ + - + + @@ -22,6 +24,7 @@ + @@ -30,9 +33,11 @@ - + + + - + \ No newline at end of file