|
1 |
| -<UserControl x:Class="Flow.Launcher.Plugin.Explorer.Views.PreviewPanel" |
2 |
| - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
3 |
| - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
4 |
| - xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
5 |
| - xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
6 |
| - xmlns:sys="clr-namespace:System;assembly=System.Runtime" |
7 |
| - mc:Ignorable="d" |
8 |
| - d:DesignHeight="300" d:DesignWidth="300"> |
9 |
| - <Grid Margin="20 0 10 0" VerticalAlignment="Stretch"> |
| 1 | +<UserControl |
| 2 | + x:Class="Flow.Launcher.Plugin.Explorer.Views.PreviewPanel" |
| 3 | + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 4 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 5 | + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
| 6 | + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
| 7 | + xmlns:sys="clr-namespace:System;assembly=System.Runtime" |
| 8 | + d:DesignHeight="300" |
| 9 | + d:DesignWidth="300" |
| 10 | + mc:Ignorable="d"> |
| 11 | + <Grid |
| 12 | + x:Name="PreviewGrid" |
| 13 | + Margin="20 0 10 0" |
| 14 | + VerticalAlignment="Stretch"> |
10 | 15 | <Grid.RowDefinitions>
|
11 | 16 | <RowDefinition Height="*" />
|
12 | 17 | <RowDefinition Height="Auto" />
|
13 | 18 | </Grid.RowDefinitions>
|
14 | 19 | <StackPanel Grid.Row="0" VerticalAlignment="Center">
|
15 | 20 | <Image
|
16 | 21 | Margin="0 16 0 0"
|
17 |
| - Source="{Binding PreviewImage, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}" |
18 | 22 | HorizontalAlignment="Stretch"
|
| 23 | + Source="{Binding PreviewImage, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}" |
19 | 24 | StretchDirection="DownOnly">
|
20 | 25 | <Image.Style>
|
21 | 26 | <Style TargetType="Image">
|
22 | 27 | <Setter Property="MaxWidth" Value="96" />
|
23 | 28 | <Setter Property="MaxHeight" Value="320" />
|
24 | 29 | <Style.Triggers>
|
25 | 30 | <DataTrigger Binding="{Binding UseBigThumbnail}" Value="True">
|
26 |
| - <Setter Property="MaxWidth" Value="{Binding ElementName=Preview, Path=ActualWidth}" /> |
27 |
| - <Setter Property="MaxHeight" Value="{Binding ElementName=Preview, Path=ActualHeight}" /> |
| 31 | + <Setter Property="MaxWidth" Value="{Binding ElementName=PreviewGrid, Path=ActualWidth}" /> |
| 32 | + <Setter Property="MaxHeight" Value="{Binding ElementName=PreviewGrid, Path=ActualHeight}" /> |
28 | 33 | </DataTrigger>
|
29 | 34 | </Style.Triggers>
|
30 | 35 | </Style>
|
|
42 | 47 | <StackPanel.Style>
|
43 | 48 | <Style TargetType="StackPanel">
|
44 | 49 | <Style.Triggers>
|
45 |
| - <DataTrigger |
46 |
| - Binding="{Binding Result.SubTitle.Length}" |
47 |
| - Value="0"> |
| 50 | + <DataTrigger Binding="{Binding Result.SubTitle.Length}" Value="0"> |
48 | 51 | <Setter Property="Visibility" Value="Collapsed" />
|
49 | 52 | </DataTrigger>
|
50 | 53 | </Style.Triggers>
|
51 | 54 | </Style>
|
52 | 55 | </StackPanel.Style>
|
53 |
| - <Separator Style="{DynamicResource PreviewSep}" /> |
54 |
| - <TextBlock |
55 |
| - Style="{DynamicResource PreviewItemSubTitleStyle}" |
56 |
| - Text="{Binding Result.SubTitle}" /> |
57 |
| - <StackPanel |
58 |
| - Visibility="{Binding FileInfoVisibility, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}"> |
59 |
| - |
60 |
| - <Separator Margin="0" Style="{DynamicResource PreviewSep}" /> |
61 |
| - |
| 56 | + <Separator /> |
| 57 | + <TextBlock Style="{DynamicResource PreviewItemSubTitleStyle}" Text="{Binding Result.SubTitle}" /> |
| 58 | + <StackPanel Visibility="{Binding FileInfoVisibility, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}"> |
62 | 59 | <Grid Margin="0 10 0 0">
|
63 | 60 | <Grid.ColumnDefinitions>
|
64 | 61 | <ColumnDefinition Width="100" />
|
|
74 | 71 | Grid.Row="0"
|
75 | 72 | Grid.Column="0"
|
76 | 73 | Margin="0 0 8 0"
|
77 |
| - Visibility="{Binding FileSizeVisibility, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}" |
78 | 74 | VerticalAlignment="Top"
|
79 | 75 | Style="{DynamicResource PreviewItemSubTitleStyle}"
|
80 | 76 | Text="{DynamicResource FileSize}"
|
81 |
| - TextWrapping="Wrap" /> |
| 77 | + TextWrapping="Wrap" |
| 78 | + Visibility="{Binding FileSizeVisibility, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}" /> |
82 | 79 | <TextBlock
|
83 | 80 | Grid.Row="0"
|
84 | 81 | Grid.Column="1"
|
85 | 82 | Margin="0"
|
86 |
| - Visibility="{Binding FileSizeVisibility, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}" |
87 | 83 | HorizontalAlignment="Right"
|
88 | 84 | VerticalAlignment="Top"
|
89 | 85 | Style="{DynamicResource PreviewItemSubTitleStyle}"
|
90 | 86 | Text="{Binding FileSize, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}"
|
91 |
| - TextWrapping="Wrap" /> |
| 87 | + TextWrapping="Wrap" |
| 88 | + Visibility="{Binding FileSizeVisibility, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}" /> |
92 | 89 |
|
93 | 90 | <TextBlock
|
94 | 91 | Grid.Row="1"
|
95 | 92 | Grid.Column="0"
|
96 | 93 | Margin="0 0 8 0"
|
97 |
| - Visibility="{Binding CreatedAtVisibility, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}" |
98 | 94 | VerticalAlignment="Top"
|
99 | 95 | Style="{DynamicResource PreviewItemSubTitleStyle}"
|
100 | 96 | Text="{DynamicResource Created}"
|
101 |
| - TextWrapping="Wrap" /> |
| 97 | + TextWrapping="Wrap" |
| 98 | + Visibility="{Binding CreatedAtVisibility, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}" /> |
102 | 99 | <TextBlock
|
103 | 100 | Grid.Row="1"
|
104 | 101 | Grid.Column="1"
|
105 | 102 | Margin="0"
|
106 |
| - Visibility="{Binding CreatedAtVisibility, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}" |
107 | 103 | HorizontalAlignment="Right"
|
108 | 104 | VerticalAlignment="Top"
|
109 | 105 | Style="{DynamicResource PreviewItemSubTitleStyle}"
|
110 | 106 | Text="{Binding CreatedAt, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}"
|
111 |
| - TextWrapping="Wrap" /> |
| 107 | + TextWrapping="Wrap" |
| 108 | + Visibility="{Binding CreatedAtVisibility, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}" /> |
112 | 109 |
|
113 | 110 | <TextBlock
|
114 | 111 | Grid.Row="2"
|
115 | 112 | Grid.Column="0"
|
116 | 113 | Margin="0 0 8 0"
|
117 |
| - Visibility="{Binding LastModifiedAtVisibility, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}" |
118 | 114 | VerticalAlignment="Top"
|
119 | 115 | Style="{DynamicResource PreviewItemSubTitleStyle}"
|
120 | 116 | Text="{DynamicResource LastModified}"
|
121 |
| - TextWrapping="Wrap" /> |
| 117 | + TextWrapping="Wrap" |
| 118 | + Visibility="{Binding LastModifiedAtVisibility, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}" /> |
122 | 119 | <TextBlock
|
123 | 120 | Grid.Row="2"
|
124 | 121 | Grid.Column="1"
|
125 | 122 | Margin="0"
|
126 |
| - Visibility="{Binding LastModifiedAtVisibility, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}" |
127 | 123 | HorizontalAlignment="Right"
|
128 | 124 | VerticalAlignment="Top"
|
129 | 125 | Style="{DynamicResource PreviewItemSubTitleStyle}"
|
130 | 126 | Text="{Binding LastModifiedAt, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}"
|
131 |
| - TextWrapping="Wrap" /> |
| 127 | + TextWrapping="Wrap" |
| 128 | + Visibility="{Binding LastModifiedAtVisibility, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}" /> |
132 | 129 | </Grid>
|
133 | 130 | </StackPanel>
|
134 | 131 | </StackPanel>
|
|
0 commit comments