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