mirror of
https://github.com/AtomUI/AtomUI.git
synced 2026-10-28 23:08:36 +08:00
Refactor ProgressBar
This commit is contained in:
@@ -233,10 +233,10 @@ public abstract class AbstractCircleProgress : AbstractProgressBar
|
||||
protected override void NotifyPropertyChanged(AvaloniaPropertyChangedEventArgs e)
|
||||
{
|
||||
base.NotifyPropertyChanged(e);
|
||||
|
||||
if (e.Property == WidthProperty || e.Property == HeightProperty)
|
||||
|
||||
if (this.IsAttachedToVisualTree())
|
||||
{
|
||||
if (this.IsAttachedToVisualTree())
|
||||
if (e.Property == WidthProperty || e.Property == HeightProperty)
|
||||
{
|
||||
CalculateStrokeThickness();
|
||||
SetupExtraInfoFontSize();
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
using AtomUI.IconPkg;
|
||||
using AtomUI.IconPkg.AntDesign;
|
||||
using AtomUI.Theme;
|
||||
using AtomUI.Theme.Data;
|
||||
using AtomUI.Theme.Styling;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Reactive.Disposables;
|
||||
using AtomUI.Controls.Utils;
|
||||
using AtomUI.IconPkg;
|
||||
using AtomUI.Media;
|
||||
using AtomUI.Theme;
|
||||
@@ -438,6 +437,15 @@ public abstract class AbstractProgressBar : RangeBase,
|
||||
{
|
||||
EffectiveSizeType = e.GetNewValue<SizeType>();
|
||||
}
|
||||
else if (e.Property == ValueProperty)
|
||||
{
|
||||
IsCompleted = MathUtils.AreClose(Value, Maximum);
|
||||
UpdatePseudoClasses();
|
||||
}
|
||||
else if (e.Property == IsCompletedProperty)
|
||||
{
|
||||
InvalidateMeasure();
|
||||
}
|
||||
|
||||
if (this.IsAttachedToVisualTree())
|
||||
{
|
||||
@@ -450,17 +458,6 @@ public abstract class AbstractProgressBar : RangeBase,
|
||||
NotifyEffectSizeTypeChanged();
|
||||
}
|
||||
}
|
||||
|
||||
if (e.Property == ValueProperty)
|
||||
{
|
||||
IsCompleted = MathUtils.AreClose(Value, Maximum);
|
||||
UpdatePseudoClasses();
|
||||
}
|
||||
else if (e.Property == IsCompletedProperty)
|
||||
{
|
||||
InvalidateMeasure();
|
||||
}
|
||||
|
||||
NotifyPropertyChanged(e);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ using Avalonia.Controls.Primitives;
|
||||
using Avalonia.Controls.Templates;
|
||||
using Avalonia.Input;
|
||||
using Avalonia.Layout;
|
||||
using Avalonia.Media;
|
||||
using Avalonia.Styling;
|
||||
|
||||
namespace AtomUI.Controls;
|
||||
|
||||
Reference in New Issue
Block a user