File tree Expand file tree Collapse file tree 2 files changed +28
-2
lines changed Expand file tree Collapse file tree 2 files changed +28
-2
lines changed Original file line number Diff line number Diff line change 438
438
HorizontalAlignment =" Center"
439
439
Source =" {Binding PreviewImage}"
440
440
StretchDirection =" DownOnly"
441
- Visibility =" {Binding ShowIcon }" >
441
+ Visibility =" {Binding ShowPreviewImage, Converter={StaticResource BoolToVisibilityConverter} }" >
442
442
<Image .Style>
443
443
<Style TargetType =" {x:Type Image}" >
444
444
<Setter Property =" MaxWidth" Value =" 96" />
Original file line number Diff line number Diff line change @@ -90,6 +90,30 @@ public Visibility ShowIcon
90
90
}
91
91
}
92
92
93
+ public bool ShowPreviewImage
94
+ {
95
+ get
96
+ {
97
+ if ( ! string . IsNullOrEmpty ( Result . Preview . PreviewImagePath ) || Result . Preview . PreviewDelegate != null )
98
+ {
99
+ return true ;
100
+ }
101
+ else
102
+ {
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 ;
113
+ }
114
+ }
115
+ }
116
+
93
117
public double IconRadius
94
118
{
95
119
get
@@ -120,6 +144,8 @@ public Visibility ShowGlyph
120
144
121
145
private bool ImgIconAvailable => ! string . IsNullOrEmpty ( Result . IcoPath ) || Result . Icon is not null ;
122
146
147
+ private bool PreviewImageAvailable => ! string . IsNullOrEmpty ( Result . Preview . PreviewImagePath ) || Result . Preview . PreviewDelegate != null ;
148
+
123
149
public string OpenResultModifiers => Settings . OpenResultModifiers ;
124
150
125
151
public string ShowTitleToolTip => string . IsNullOrEmpty ( Result . TitleToolTip )
@@ -218,7 +244,7 @@ public void LoadPreviewImage()
218
244
{
219
245
if ( ShowDefaultPreview == Visibility . Visible )
220
246
{
221
- if ( ! PreviewImageLoaded && ShowIcon == Visibility . Visible )
247
+ if ( ! PreviewImageLoaded && ShowPreviewImage )
222
248
{
223
249
PreviewImageLoaded = true ;
224
250
_ = LoadPreviewImageAsync ( ) ;
You can’t perform that action at this time.
0 commit comments