From 600cd302981a30fcecace21de1add045dd6ef15a Mon Sep 17 00:00:00 2001 From: polarboy Date: Sat, 28 Sep 2024 14:41:18 +0800 Subject: [PATCH] Fixed CheckBox Mark Size calculated Bug --- .../ShowCase/CheckBoxShowCase.axaml | 200 +++++++++--------- .../CheckBox/CheckBoxIndicator.cs | 7 +- 2 files changed, 106 insertions(+), 101 deletions(-) diff --git a/samples/AtomUI.Demo.Desktop/ShowCase/CheckBoxShowCase.axaml b/samples/AtomUI.Demo.Desktop/ShowCase/CheckBoxShowCase.axaml index d2b3de3..6fb7be8 100644 --- a/samples/AtomUI.Demo.Desktop/ShowCase/CheckBoxShowCase.axaml +++ b/samples/AtomUI.Demo.Desktop/ShowCase/CheckBoxShowCase.axaml @@ -21,105 +21,105 @@ - - - UnChecked - Indeterminate - Checked - - - - - - - - - - - - - - - - - Apple - Pear - Orange - - - Apple - Pear - Orange - - - Apple - Pear - Orange - - - - - - - - - - Check all - - - - - Apple - - - Pear - - - Orange - - - - - - - - A - B - C - D - D - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/AtomUI.Controls/CheckBox/CheckBoxIndicator.cs b/src/AtomUI.Controls/CheckBox/CheckBoxIndicator.cs index 607f060..f8d8313 100644 --- a/src/AtomUI.Controls/CheckBox/CheckBoxIndicator.cs +++ b/src/AtomUI.Controls/CheckBox/CheckBoxIndicator.cs @@ -130,7 +130,6 @@ internal class CheckBoxIndicator : Control, IWaveAdornerInfoProvider public override void ApplyTemplate() { base.ApplyTemplate(); - SetupIndicatorCheckedMarkEffectSize(); Transitions ??= new Transitions { AnimationUtils.CreateTransition(BackgroundProperty), @@ -177,6 +176,12 @@ internal class CheckBoxIndicator : Control, IWaveAdornerInfoProvider WaveSpiritAdorner.ShowWaveAdorner(this, WaveType.RoundRectWave); } } + + if (e.Property == SizeProperty) + { + CollectStyleState(); + SetupIndicatorCheckedMarkEffectSize(); + } } private void SetupIndicatorCheckedMarkEffectSize()