@@ -91,7 +91,7 @@ public Visibility ShowPreviewImage
9191 {
9292 if ( PreviewImageAvailable )
9393 return Visibility . Visible ;
94-
94+
9595 // Fall back to icon
9696 return ShowIcon ;
9797 }
@@ -103,7 +103,7 @@ public double IconRadius
103103 {
104104 if ( Result . RoundedIcon )
105105 return IconXY / 2 ;
106-
106+
107107 return IconXY ;
108108 }
109109 }
@@ -121,32 +121,12 @@ public Visibility ShowGlyph
121121 }
122122 }
123123
124- public Visibility ShowBadge
125- {
126- get
127- {
128- // If results do not allow badges, or user has disabled badges in settings,
129- // or badge icon is not available, then do not show badge
130- if ( ! Result . ShowBadge || ! Settings . ShowBadges || ! BadgeIconAvailable )
131- return Visibility . Collapsed ;
132-
133- // If user has set to show badges only for global results, and this is not a global result,
134- // then do not show badge
135- if ( Settings . ShowBadgesGlobalOnly && ! IsGlobalQuery )
136- return Visibility . Collapsed ;
137-
138- return Visibility . Visible ;
139- }
140- }
141-
142124 public bool IsGlobalQuery => string . IsNullOrEmpty ( Result . OriginQuery . ActionKeyword ) ;
143125
144126 private bool GlyphAvailable => Glyph is not null ;
145127
146128 private bool ImgIconAvailable => ! string . IsNullOrEmpty ( Result . IcoPath ) || Result . Icon is not null ;
147129
148- private bool BadgeIconAvailable => ! string . IsNullOrEmpty ( Result . BadgeIcoPath ) || Result . BadgeIcon is not null ;
149-
150130 private bool PreviewImageAvailable => ! string . IsNullOrEmpty ( Result . Preview . PreviewImagePath ) || Result . Preview . PreviewDelegate != null ;
151131
152132 public string ShowTitleToolTip => string . IsNullOrEmpty ( Result . TitleToolTip )
@@ -158,11 +138,9 @@ public Visibility ShowBadge
158138 : Result . SubTitleToolTip ;
159139
160140 private volatile bool _imageLoaded ;
161- private volatile bool _badgeImageLoaded ;
162141 private volatile bool _previewImageLoaded ;
163142
164143 private ImageSource _image = ImageLoader . LoadingImage ;
165- private ImageSource _badgeImage = ImageLoader . LoadingImage ;
166144 private ImageSource _previewImage = ImageLoader . LoadingImage ;
167145
168146 public ImageSource Image
@@ -180,21 +158,6 @@ public ImageSource Image
180158 private set => _image = value ;
181159 }
182160
183- public ImageSource BadgeImage
184- {
185- get
186- {
187- if ( ! _badgeImageLoaded )
188- {
189- _badgeImageLoaded = true ;
190- _ = LoadBadgeImageAsync ( ) ;
191- }
192-
193- return _badgeImage ;
194- }
195- private set => _badgeImage = value ;
196- }
197-
198161 public ImageSource PreviewImage
199162 {
200163 get
@@ -251,21 +214,6 @@ private async Task LoadImageAsync()
251214 }
252215 }
253216
254- private async Task LoadBadgeImageAsync ( )
255- {
256- var badgeImagePath = Result . BadgeIcoPath ;
257- var badgeIconDelegate = Result . BadgeIcon ;
258- if ( ImageLoader . TryGetValue ( badgeImagePath , false , out var img ) )
259- {
260- _badgeImage = img ;
261- }
262- else
263- {
264- // We need to modify the property not field here to trigger the OnPropertyChanged event
265- BadgeImage = await LoadImageInternalAsync ( badgeImagePath , badgeIconDelegate , false ) . ConfigureAwait ( false ) ;
266- }
267- }
268-
269217 private async Task LoadPreviewImageAsync ( )
270218 {
271219 var imagePath = Result . Preview . PreviewImagePath ?? Result . IcoPath ;
0 commit comments