feat: improve TreeViewItem padding.

This commit is contained in:
rabbitism 2023-03-26 18:15:59 +08:00
parent 6885575c85
commit 016160dee8
4 changed files with 11 additions and 8 deletions

View File

@ -1,9 +1,13 @@
<UserControl
x:Class="Semi.Avalonia.Demo.Pages.TreeViewDemo" xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" d:DesignHeight="450"
d:DesignWidth="800" mc:Ignorable="d">
<Panel>
x:Class="Semi.Avalonia.Demo.Pages.TreeViewDemo"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
<Panel HorizontalAlignment="Left">
<TreeView>
<TreeViewItem Header="Level 1">
<TreeViewItem Header="Level 2" />

View File

@ -93,7 +93,6 @@
</ControlTheme>
<ControlTheme x:Key="{x:Type TreeViewItem}" TargetType="TreeViewItem">
<Setter Property="TreeViewItem.Padding" Value="0" />
<Setter Property="TreeViewItem.Background" Value="{DynamicResource TreeViewItemDefaultBackground}" />
<Setter Property="TreeViewItem.Foreground" Value="{DynamicResource TreeViewItemDefaultForeground}" />
<Setter Property="TreeViewItem.CornerRadius" Value="3" />

View File

@ -21,5 +21,5 @@
<SolidColorBrush x:Key="TreeViewItemSelectedDisabledBackground" Opacity="0.04" Color="#E6E8EA" />
<Thickness x:Key="TreeViewItemIconMargin">8 0</Thickness>
<Thickness x:Key="TreeViewItemPadding">0 4 0 4</Thickness>
<Thickness x:Key="TreeViewItemPadding">0 4 8 4</Thickness>
</ResourceDictionary>

View File

@ -21,5 +21,5 @@
<SolidColorBrush x:Key="TreeViewItemSelectedDisabledBackground" Opacity="0.02" Color="#2E3238" />
<Thickness x:Key="TreeViewItemIconMargin">8 0</Thickness>
<Thickness x:Key="TreeViewItemPadding">0 4 0 4</Thickness>
<Thickness x:Key="TreeViewItemPadding">0 4 8 4</Thickness>
</ResourceDictionary>