From 2a38bb09a2a6603d9c3a86696550a80c97eb6b5e Mon Sep 17 00:00:00 2001 From: rabbitism Date: Thu, 23 Mar 2023 23:25:29 +0800 Subject: [PATCH] misc: update timelineitem style --- demo/Ursa.Demo/Pages/TimelineDemo.axaml | 15 +---- src/Ursa.Themes.Semi/Controls/Timeline.axaml | 12 ++-- src/Ursa/Controls/Timeline/TimelineItem.cs | 60 +------------------- 3 files changed, 10 insertions(+), 77 deletions(-) diff --git a/demo/Ursa.Demo/Pages/TimelineDemo.axaml b/demo/Ursa.Demo/Pages/TimelineDemo.axaml index d77dbca..0671c98 100644 --- a/demo/Ursa.Demo/Pages/TimelineDemo.axaml +++ b/demo/Ursa.Demo/Pages/TimelineDemo.axaml @@ -16,18 +16,9 @@ - - - + + + diff --git a/src/Ursa.Themes.Semi/Controls/Timeline.axaml b/src/Ursa.Themes.Semi/Controls/Timeline.axaml index b36677a..801865d 100644 --- a/src/Ursa.Themes.Semi/Controls/Timeline.axaml +++ b/src/Ursa.Themes.Semi/Controls/Timeline.axaml @@ -33,7 +33,7 @@ Width="1" VerticalAlignment="Stretch" Classes="end" - Fill="Gray" /> + Fill="LightGray" /> + Fill="LightGray" /> + Fill="LightGray" /> + Fill="LightGray" /> + Foreground="Gray"> diff --git a/src/Ursa/Controls/Timeline/TimelineItem.cs b/src/Ursa/Controls/Timeline/TimelineItem.cs index 2760bb7..915644c 100644 --- a/src/Ursa/Controls/Timeline/TimelineItem.cs +++ b/src/Ursa/Controls/Timeline/TimelineItem.cs @@ -23,15 +23,6 @@ public class TimelineItem: ContentControl set => SetValue(IconForegroundProperty, value); } - public static readonly StyledProperty DescriptionProperty = - AvaloniaProperty.Register(nameof(Description)); - - public object? Description - { - get => GetValue(DescriptionProperty); - set => SetValue(DescriptionProperty, value); - } - public static readonly StyledProperty TimeProperty = AvaloniaProperty.Register( nameof(Time)); public DateTime Time @@ -41,7 +32,7 @@ public class TimelineItem: ContentControl } public static readonly StyledProperty TimeFormatProperty = AvaloniaProperty.Register( - nameof(TimeFormat), defaultValue:CultureInfo.CurrentUICulture.DateTimeFormat.SortableDateTimePattern); + nameof(TimeFormat), defaultValue:CultureInfo.CurrentUICulture.DateTimeFormat.ShortDatePattern); public string? TimeFormat { @@ -63,53 +54,4 @@ public class TimelineItem: ContentControl PseudoClasses.Set(PC_First, isFirst); PseudoClasses.Set(PC_Last, isLast); } -} - -public class TimelineItemLayoutProperties: AvaloniaObject -{ - private double _dimensionDelta = 0.01; - - public static readonly StyledProperty TimeSlotWidthProperty = AvaloniaProperty.Register( - nameof(TimeSlotWidth)); - - public double TimeSlotWidth - { - get => GetValue(TimeSlotWidthProperty); - set - { - if (Math.Abs(GetValue(TimeSlotWidthProperty) - value) < _dimensionDelta) return; - SetValue(TimeSlotWidthProperty, value); - } - } - - public static readonly StyledProperty TimeSlotHeightProperty = AvaloniaProperty.Register( - nameof(TimeSlotHeight)); - - public double TimeSlotHeight - { - get => GetValue(TimeSlotHeightProperty); - set - { - if (Math.Abs(GetValue(TimeSlotHeightProperty) - value) < _dimensionDelta) return; - SetValue(TimeSlotHeightProperty, value); - } - } - - public static readonly StyledProperty ContentSlotWidthProperty = AvaloniaProperty.Register( - nameof(ContentSlotWidth)); - - public double ContentSlotWidth - { - get => GetValue(ContentSlotWidthProperty); - set => SetValue(ContentSlotWidthProperty, value); - } - - public static readonly StyledProperty ContentSlotHeightProperty = AvaloniaProperty.Register( - nameof(ContentSlotHeight)); - - public double ContentSlotHeight - { - get => GetValue(ContentSlotHeightProperty); - set => SetValue(ContentSlotHeightProperty, value); - } } \ No newline at end of file