mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-13 11:09:06 +00:00
Use fluent UI for ArchiveFileListView
TreeView style is from WPF-UI
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
<UserControl x:Class="QuickLook.Plugin.ArchiveViewer.ArchiveFileListView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:QuickLook.Plugin.ArchiveViewer"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="300" d:DesignWidth="300">
|
||||
<Grid Grid.IsSharedSizeScope="True"
|
||||
x:Name="treeGrid">
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
d:DesignHeight="300"
|
||||
d:DesignWidth="300"
|
||||
mc:Ignorable="d">
|
||||
<Grid x:Name="treeGrid" Grid.IsSharedSizeScope="True">
|
||||
<Grid.RowDefinitions>
|
||||
<!-- Header row -->
|
||||
<RowDefinition Height="Auto" />
|
||||
@@ -26,8 +26,7 @@
|
||||
<local:LevelToBooleanConverter x:Key="LevelToBooleanConverter" />
|
||||
|
||||
<!-- Template for directory information at all levels -->
|
||||
<HierarchicalDataTemplate ItemsSource="{Binding Children.Keys}"
|
||||
DataType="{x:Type local:ArchiveFileEntry}">
|
||||
<HierarchicalDataTemplate DataType="{x:Type local:ArchiveFileEntry}" ItemsSource="{Binding Children.Keys}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="2" />
|
||||
@@ -35,8 +34,10 @@
|
||||
<RowDefinition Height="2" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Grid.Row="1" ShowGridLines="False">
|
||||
<!-- All column widths are shared except for column 1 which is sized
|
||||
to compensate for different indentation at each level -->
|
||||
<!--
|
||||
All column widths are shared except for column 1 which is sized
|
||||
to compensate for different indentation at each level
|
||||
-->
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition MinWidth="300" SharedSizeGroup="rowHeaderColumn" />
|
||||
<ColumnDefinition />
|
||||
@@ -53,15 +54,13 @@
|
||||
</Image.Source>
|
||||
</Image>
|
||||
<TextBlock Text="{Binding Name}" />
|
||||
<TextBlock
|
||||
Text="{Binding Encrypted, Converter={StaticResource BooleanToAsteriskConverter}}" />
|
||||
<TextBlock Text="{Binding Encrypted, Converter={StaticResource BooleanToAsteriskConverter}}" />
|
||||
</StackPanel>
|
||||
<Rectangle Grid.Column="1">
|
||||
<Rectangle.Width>
|
||||
<MultiBinding Converter="{StaticResource LevelToIndentConverter}">
|
||||
<Binding Path="Level" />
|
||||
<Binding ElementName="treeViewItemToMeasure"
|
||||
Path="ActualWidth" />
|
||||
<Binding ElementName="treeViewItemToMeasure" Path="ActualWidth" />
|
||||
</MultiBinding>
|
||||
</Rectangle.Width>
|
||||
</Rectangle>
|
||||
@@ -88,7 +87,9 @@
|
||||
|
||||
<!-- Tree view with one item for the header row -->
|
||||
|
||||
<TreeView BorderThickness="0" Focusable="False" Background="Transparent"
|
||||
<TreeView Background="Transparent"
|
||||
BorderThickness="0"
|
||||
Focusable="False"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Disabled">
|
||||
<TreeViewItem Focusable="False" Visibility="Collapsed">
|
||||
<TreeViewItem.Header>
|
||||
@@ -99,28 +100,25 @@
|
||||
<ColumnDefinition SharedSizeGroup="column1" />
|
||||
<ColumnDefinition SharedSizeGroup="column2" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Grid.Column="0"
|
||||
Text=" " />
|
||||
<TextBlock Grid.Column="0" Text=" " />
|
||||
<TreeViewItem Grid.Column="1">
|
||||
<TreeViewItem.Header>
|
||||
<TreeViewItem x:Name="treeViewItemToMeasure"
|
||||
Padding="0" />
|
||||
<TreeViewItem x:Name="treeViewItemToMeasure" Padding="0" />
|
||||
</TreeViewItem.Header>
|
||||
|
||||
<!-- Set the width of Column 1 to the same width as the top level
|
||||
in the data -->
|
||||
<!--
|
||||
Set the width of Column 1 to the same width as the top level
|
||||
in the data
|
||||
-->
|
||||
<TreeViewItem.Width>
|
||||
<MultiBinding Converter="{StaticResource LevelToIndentConverter}">
|
||||
<Binding Path="Level" />
|
||||
<Binding ElementName="treeViewItemToMeasure"
|
||||
Path="ActualWidth" />
|
||||
<Binding ElementName="treeViewItemToMeasure" Path="ActualWidth" />
|
||||
</MultiBinding>
|
||||
</TreeViewItem.Width>
|
||||
</TreeViewItem>
|
||||
<TextBlock Grid.Column="2"
|
||||
Text="Original Size" />
|
||||
<TextBlock Grid.Column="3"
|
||||
Text="Modified Date" />
|
||||
<TextBlock Grid.Column="2" Text="Original Size" />
|
||||
<TextBlock Grid.Column="3" Text="Modified Date" />
|
||||
</Grid>
|
||||
</TreeViewItem.Header>
|
||||
</TreeViewItem>
|
||||
@@ -128,15 +126,8 @@
|
||||
|
||||
<!-- Tree view that will display hierarchical data rows -->
|
||||
|
||||
<TreeView Grid.Row="1"
|
||||
x:Name="treeView"
|
||||
BorderThickness="0" Background="Transparent" Foreground="{Binding Foreground, RelativeSource={RelativeSource AncestorType=local:ArchiveFileListView}}"
|
||||
ItemsSource="{Binding}">
|
||||
<TreeView.ItemContainerStyle>
|
||||
<Style TargetType="{x:Type TreeViewItem}">
|
||||
<Setter Property="Foreground" Value="{Binding Foreground, RelativeSource={RelativeSource AncestorType=TreeView}}" />
|
||||
</Style>
|
||||
</TreeView.ItemContainerStyle>
|
||||
</TreeView>
|
||||
<TreeView x:Name="treeView"
|
||||
Grid.Row="1"
|
||||
ItemsSource="{Binding}" />
|
||||
</Grid>
|
||||
</UserControl>
|
Reference in New Issue
Block a user