From d63a0f6bea65cef745d916f7d42d283b680c997a Mon Sep 17 00:00:00 2001 From: Dong Bin Date: Sat, 18 Jan 2025 02:02:42 +0800 Subject: [PATCH] update style. --- demo/Ursa.Demo/Pages/PathPickerDemo.axaml | 32 +++--- .../Controls/PathPicker.axaml | 108 +++++++++++------- src/Ursa/Controls/PathPicker/PathPicker.cs | 18 +-- 3 files changed, 90 insertions(+), 68 deletions(-) diff --git a/demo/Ursa.Demo/Pages/PathPickerDemo.axaml b/demo/Ursa.Demo/Pages/PathPickerDemo.axaml index 50fa8c1..fc6fc0f 100644 --- a/demo/Ursa.Demo/Pages/PathPickerDemo.axaml +++ b/demo/Ursa.Demo/Pages/PathPickerDemo.axaml @@ -16,7 +16,7 @@ Content="PathPicker aggregates a file selector and provides a Command property. The Command is triggered solely after opening the file selector and selecting a file, whereupon the Command receives an IReadOnlyList<string> parameter."> - + @@ -29,18 +29,19 @@ - - - - - - + + + + + + + @@ -48,11 +49,12 @@ - - + - + + + + + + + + - - - - + + + - + diff --git a/src/Ursa/Controls/PathPicker/PathPicker.cs b/src/Ursa/Controls/PathPicker/PathPicker.cs index e4e69d2..6cb2b2e 100644 --- a/src/Ursa/Controls/PathPicker/PathPicker.cs +++ b/src/Ursa/Controls/PathPicker/PathPicker.cs @@ -5,19 +5,17 @@ using Avalonia.Controls; using Avalonia.Controls.Metadata; using Avalonia.Controls.Primitives; using Avalonia.Data; -using Avalonia.Input; using Avalonia.Interactivity; using Avalonia.Logging; using Avalonia.Platform.Storage; -using Avalonia.Threading; -using Irihi.Avalonia.Shared.Common; using Irihi.Avalonia.Shared.Helpers; namespace Ursa.Controls; -[TemplatePart(Name = "PART_Button", Type = typeof(Button))] +[TemplatePart(Name = PART_Button, Type = typeof(Button))] public class PathPicker : TemplatedControl { + public const string PART_Button = "PART_Button"; public static readonly StyledProperty SuggestedStartPathProperty = AvaloniaProperty.Register( nameof(SuggestedStartPath), string.Empty); @@ -185,7 +183,7 @@ public class PathPicker : TemplatedControl { base.OnApplyTemplate(e); Button.ClickEvent.RemoveHandler(LaunchPicker, _button); - _button = e.NameScope.Find