mirror of
https://github.com/AtomUI/AtomUI.git
synced 2026-10-22 00:46:48 +08:00
Fix Expander expand icon position bug
This commit is contained in:
@@ -278,6 +278,14 @@ public class Expander : AvaloniaExpander,
|
||||
}
|
||||
}
|
||||
|
||||
if (this.IsAttachedToVisualTree())
|
||||
{
|
||||
if (change.Property == IsBorderlessProperty)
|
||||
{
|
||||
SetupEffectiveBorderThickness();
|
||||
}
|
||||
}
|
||||
|
||||
if (change.Property == ExpandIconProperty)
|
||||
{
|
||||
if (change.OldValue is Icon oldIcon)
|
||||
@@ -290,16 +298,7 @@ public class Expander : AvaloniaExpander,
|
||||
newIcon.SetTemplatedParent(this);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.IsAttachedToVisualTree())
|
||||
{
|
||||
if (change.Property == IsBorderlessProperty)
|
||||
{
|
||||
SetupEffectiveBorderThickness();
|
||||
}
|
||||
}
|
||||
|
||||
if (change.Property == IsExpandedProperty)
|
||||
else if (change.Property == IsExpandedProperty)
|
||||
{
|
||||
HandleExpandedChanged();
|
||||
}
|
||||
@@ -310,6 +309,18 @@ public class Expander : AvaloniaExpander,
|
||||
{
|
||||
SetupExpanderBorderThickness();
|
||||
}
|
||||
else if (change.Property == AddOnContentProperty)
|
||||
{
|
||||
if (change.OldValue is Control oldControl)
|
||||
{
|
||||
oldControl.SetTemplatedParent(null);
|
||||
}
|
||||
|
||||
if (change.NewValue is Control newControl)
|
||||
{
|
||||
newControl.SetTemplatedParent(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SetupDefaultIcon()
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using AtomUI.IconPkg;
|
||||
using AtomUI.Theme;
|
||||
using AtomUI.Theme.Data;
|
||||
using AtomUI.Theme.Styling;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
|
||||
@@ -3,7 +3,6 @@ using AtomUI.Data;
|
||||
using AtomUI.Theme;
|
||||
using AtomUI.Theme.Data;
|
||||
using AtomUI.Theme.Styling;
|
||||
using AtomUI.Utils;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.Presenters;
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
using AtomUI.IconPkg;
|
||||
using AtomUI.IconPkg.AntDesign;
|
||||
using AtomUI.Theme;
|
||||
using AtomUI.Theme.Data;
|
||||
using AtomUI.IconPkg.AntDesign;
|
||||
using AtomUI.Theme.Styling;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
using AtomUI.Theme;
|
||||
using AtomUI.Theme.Data;
|
||||
using AtomUI.Theme.Styling;
|
||||
using AtomUI.Utils;
|
||||
using AtomUI.Theme.Styling;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.Presenters;
|
||||
using Avalonia.Controls.Templates;
|
||||
|
||||
Reference in New Issue
Block a user