misc: format codes.

This commit is contained in:
Zhang Dian
2025-04-16 22:09:11 +08:00
parent 3c4da0f82c
commit cae26f2134
2 changed files with 7 additions and 11 deletions

View File

@@ -52,7 +52,7 @@
</ControlTemplate>
</Setter>
</ControlTheme>
<ControlTheme x:Key="ToggleButtonTreeViewItemIconButton" TargetType="ToggleButton">
<Setter Property="Margin" Value="0" />
<Setter Property="Cursor" Value="Hand" />
@@ -118,8 +118,7 @@
Grid.Column="0"
Padding="{DynamicResource TreeViewItemIconMargin}"
Focusable="False"
IsChecked="{TemplateBinding IsExpanded,
Mode=TwoWay}"
IsChecked="{TemplateBinding IsExpanded,Mode=TwoWay}"
Theme="{StaticResource ToggleButtonTreeViewItemIconButton}" />
<ContentPresenter
Name="PART_HeaderPresenter"

View File

@@ -6,20 +6,17 @@ using Avalonia.Data.Converters;
namespace Semi.Avalonia.Converters;
public class TreeViewItemIndentConverter: IMultiValueConverter
public class TreeViewItemIndentConverter : IMultiValueConverter
{
public static readonly TreeViewItemIndentConverter Instance = new();
public object? Convert(IList<object?> values, Type targetType, object? parameter, CultureInfo culture)
{
if (values.Count>1 && values[0] is int level && values[1] is double indent)
if (values.Count > 1 && values[0] is int level && values[1] is double indent)
{
return new Thickness(
indent * level,
0,
0,
0);
return new Thickness(indent * level, 0, 0, 0);
}
return new Thickness(0);
}
}