Skip to content

Commit 62821d3

Browse files
Use Visibility for consistency
1 parent e83e21d commit 62821d3

File tree

3 files changed

+7
-16
lines changed

3 files changed

+7
-16
lines changed

Flow.Launcher/MainWindow.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@
438438
HorizontalAlignment="Center"
439439
Source="{Binding PreviewImage}"
440440
StretchDirection="DownOnly"
441-
Visibility="{Binding ShowPreviewImage, Converter={StaticResource BoolToVisibilityConverter}}">
441+
Visibility="{Binding ShowPreviewImage}">
442442
<Image.Style>
443443
<Style TargetType="{x:Type Image}">
444444
<Setter Property="MaxWidth" Value="96" />

Flow.Launcher/ViewModel/ResultViewModel.cs

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -90,26 +90,18 @@ public Visibility ShowIcon
9090
}
9191
}
9292

93-
public bool ShowPreviewImage
93+
public Visibility ShowPreviewImage
9494
{
9595
get
9696
{
97-
if (!string.IsNullOrEmpty(Result.Preview.PreviewImagePath) || Result.Preview.PreviewDelegate != null)
97+
if (PreviewImageAvailable)
9898
{
99-
return true;
99+
return Visibility.Visible;
100100
}
101101
else
102102
{
103-
// Fall back to Icon
104-
if (!ImgIconAvailable && !GlyphAvailable)
105-
return true;
106-
107-
// Although user can choose to use glyph icons, plugins may choose to supply only image icons.
108-
// In this case we ignore the setting because otherwise icons will not display as intended
109-
if (Settings.UseGlyphIcons && !GlyphAvailable && ImgIconAvailable)
110-
return true;
111-
112-
return !Settings.UseGlyphIcons && ImgIconAvailable;
103+
// Fall back to icon
104+
return ShowIcon;
113105
}
114106
}
115107
}
@@ -244,7 +236,7 @@ public void LoadPreviewImage()
244236
{
245237
if (ShowDefaultPreview == Visibility.Visible)
246238
{
247-
if (!PreviewImageLoaded && ShowPreviewImage)
239+
if (!PreviewImageLoaded && ShowPreviewImage == Visibility.Visible)
248240
{
249241
PreviewImageLoaded = true;
250242
_ = LoadPreviewImageAsync();

Flow.Launcher/ViewModel/ResultsViewModel.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
using System.Windows.Data;
1010
using System.Windows.Documents;
1111
using System.Windows.Input;
12-
using JetBrains.Annotations;
1312

1413
namespace Flow.Launcher.ViewModel
1514
{

0 commit comments

Comments
 (0)