Skip to content

Commit abb0c02

Browse files
committed
Fix file info in preview panel of explorer plugin disappearing when file size display is disabled
1 parent 5b561f4 commit abb0c02

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

Plugins/Flow.Launcher.Plugin.Explorer/Views/PreviewPanel.xaml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,12 @@
5454
<TextBlock
5555
Style="{DynamicResource PreviewItemSubTitleStyle}"
5656
Text="{Binding Result.SubTitle}" />
57-
<StackPanel Orientation="Vertical">
58-
<StackPanel.Style>
59-
<Style TargetType="StackPanel">
60-
<Style.Triggers>
61-
<DataTrigger
62-
Binding="{Binding ElementName=SizeValue, Path=Text}"
63-
Value="{x:Static sys:String.Empty}">
64-
<Setter Property="Height" Value="0" />
65-
</DataTrigger>
66-
</Style.Triggers>
67-
</Style>
68-
</StackPanel.Style>
57+
<StackPanel
58+
Visibility="{Binding FileInfoVisibility, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}">
59+
6960
<Separator Margin="0" Style="{DynamicResource PreviewSep}" />
70-
<Grid Margin="0 10 0 0" VerticalAlignment="Center">
61+
62+
<Grid Margin="0 10 0 0">
7163
<Grid.ColumnDefinitions>
7264
<ColumnDefinition Width="100" />
7365
<ColumnDefinition Width="*" />
@@ -77,6 +69,7 @@
7769
<RowDefinition Height="Auto" />
7870
<RowDefinition Height="Auto" />
7971
</Grid.RowDefinitions>
72+
8073
<TextBlock
8174
Grid.Row="0"
8275
Grid.Column="0"
@@ -87,7 +80,6 @@
8780
Text="{DynamicResource FileSize}"
8881
TextWrapping="Wrap" />
8982
<TextBlock
90-
Name="SizeValue"
9183
Grid.Row="0"
9284
Grid.Column="1"
9385
Margin="0"

Plugins/Flow.Launcher.Plugin.Explorer/Views/PreviewPanel.xaml.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ private set
4343
? Visibility.Visible
4444
: Visibility.Collapsed;
4545

46+
public Visibility FileInfoVisibility =>
47+
Settings.ShowFileSizeInPreviewPanel ||
48+
Settings.ShowCreatedDateInPreviewPanel ||
49+
Settings.ShowModifiedDateInPreviewPanel
50+
? Visibility.Visible
51+
: Visibility.Collapsed;
52+
4653
public PreviewPanel(Settings settings, string filePath)
4754
{
4855
InitializeComponent();

0 commit comments

Comments
 (0)