fix: Fix TreeViewItem ToggleButton size.
This commit is contained in:
parent
3fe073e405
commit
f42cbba0a0
@ -1,10 +1,12 @@
|
||||
<ResourceDictionary
|
||||
xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:converters="clr-namespace:Avalonia.Controls.Converters;assembly=Avalonia.Controls">
|
||||
|
||||
<Design.PreviewWith>
|
||||
<StackPanel
|
||||
Height="200" Margin="20"
|
||||
Height="200"
|
||||
Margin="20"
|
||||
Spacing="20">
|
||||
<TreeView>
|
||||
<TreeViewItem Header="Level 1">
|
||||
@ -62,7 +64,9 @@
|
||||
<Border
|
||||
Width="{TemplateBinding Width}"
|
||||
Height="{TemplateBinding Height}"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
Background="Transparent">
|
||||
<PathIcon
|
||||
Name="PART_ExpandIconPath"
|
||||
@ -100,30 +104,31 @@
|
||||
<Border
|
||||
Name="PART_LayoutRoot"
|
||||
MinHeight="{TemplateBinding MinHeight}"
|
||||
Padding="{DynamicResource TreeViewItemPadding}"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
Focusable="True" TemplatedControl.IsTemplateFocusTarget="True">
|
||||
Focusable="True"
|
||||
TemplatedControl.IsTemplateFocusTarget="True">
|
||||
<Grid
|
||||
Name="PART_Header"
|
||||
Margin="{TemplateBinding Level,
|
||||
Mode=OneWay,
|
||||
Converter={StaticResource TreeViewItemLeftMarginConverter}}"
|
||||
ColumnDefinitions="Auto, *">
|
||||
<Panel
|
||||
Name="PART_ExpandCollapseChevronContainer" Grid.Column="0"
|
||||
Margin="{StaticResource TreeViewItemIconMargin}">
|
||||
<ToggleButton
|
||||
Name="PART_ExpandCollapseChevron" Focusable="False"
|
||||
Name="PART_ExpandCollapseChevron"
|
||||
Grid.Column="0"
|
||||
Padding="{DynamicResource TreeViewItemIconMargin}"
|
||||
Focusable="False"
|
||||
IsChecked="{TemplateBinding IsExpanded,
|
||||
Mode=TwoWay}"
|
||||
Theme="{StaticResource ToggleButtonTreeViewItemIconButton}" />
|
||||
</Panel>
|
||||
<ContentPresenter
|
||||
Name="PART_HeaderPresenter" Grid.Column="1"
|
||||
Name="PART_HeaderPresenter"
|
||||
Grid.Column="1"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
Padding="{DynamicResource TreeViewItemPadding}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalAlignment}"
|
||||
Content="{TemplateBinding Header}"
|
||||
|
@ -1,5 +1,6 @@
|
||||
<ResourceDictionary
|
||||
xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:sys="clr-namespace:System;assembly=System.Runtime">
|
||||
<sys:Double x:Key="TreeViewItemIndent">20</sys:Double>
|
||||
<sys:Double x:Key="TreeViewItemIconSize">8</sys:Double>
|
||||
@ -19,6 +20,6 @@
|
||||
<SolidColorBrush x:Key="TreeViewItemDisabledBackground" Color="Transparent" />
|
||||
<SolidColorBrush x:Key="TreeViewItemSelectedDisabledBackground" Opacity="0.04" Color="#2E3238" />
|
||||
|
||||
<Thickness x:Key="TreeViewItemIconMargin">0 0 8 0</Thickness>
|
||||
<Thickness x:Key="TreeViewItemPadding">8 4 0 4</Thickness>
|
||||
<Thickness x:Key="TreeViewItemIconMargin">8 0</Thickness>
|
||||
<Thickness x:Key="TreeViewItemPadding">0 4 0 4</Thickness>
|
||||
</ResourceDictionary>
|
||||
|
Loading…
x
Reference in New Issue
Block a user