File tree Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change 190
190
</TextBox .ContextMenu>
191
191
</TextBox >
192
192
<Canvas Style =" {DynamicResource SearchIconPosition}" >
193
+ <Image
194
+ x : Name =" PluginActivationIcon"
195
+ Width =" 32"
196
+ Height =" 32"
197
+ Margin =" 0,0,0,0"
198
+ HorizontalAlignment =" Center"
199
+ VerticalAlignment =" Center"
200
+ Panel.ZIndex=" 2"
201
+ RenderOptions.BitmapScalingMode=" HighQuality"
202
+ Source =" {Binding PluginIconPath}"
203
+ Stretch =" Uniform"
204
+ Style =" {DynamicResource PluginActivationIcon}" />
193
205
<Path
194
206
Name =" SearchIcon"
195
207
Margin =" 0"
196
208
Data =" {DynamicResource SearchIconImg}"
197
209
Stretch =" Fill"
198
- Style =" {DynamicResource SearchIconStyle}" />
210
+ Style =" {DynamicResource SearchIconStyle}"
211
+ Visibility =" {Binding SearchIconVisibility}" />
199
212
</Canvas >
200
213
</Grid >
201
214
Original file line number Diff line number Diff line change @@ -391,8 +391,12 @@ private ResultsViewModel SelectedResults
391
391
// because it is more accurate and reliable representation than using Visibility as a condition check
392
392
public bool MainWindowVisibilityStatus { get ; set ; } = true ;
393
393
394
+ public Visibility SearchIconVisibility { get ; set ; }
395
+
394
396
public double MainWindowWidth => _settings . WindowSize ;
395
397
398
+ public string PluginIconPath { get ; set ; } = null ;
399
+
396
400
public ICommand EscCommand { get ; set ; }
397
401
public ICommand SelectNextItemCommand { get ; set ; }
398
402
public ICommand SelectPrevItemCommand { get ; set ; }
@@ -526,6 +530,8 @@ private async void QueryResults()
526
530
{
527
531
Results . Clear ( ) ;
528
532
Results . Visbility = Visibility . Collapsed ;
533
+ PluginIconPath = null ;
534
+ SearchIconVisibility = Visibility . Visible ;
529
535
return ;
530
536
}
531
537
@@ -554,6 +560,18 @@ private async void QueryResults()
554
560
555
561
var plugins = PluginManager . ValidPluginsForQuery ( query ) ;
556
562
563
+ if ( plugins . Count == 1 )
564
+ {
565
+ PluginIconPath = plugins . Single ( ) . Metadata . IcoPath ;
566
+ SearchIconVisibility = Visibility . Hidden ;
567
+ }
568
+ else
569
+ {
570
+ PluginIconPath = null ;
571
+ SearchIconVisibility = Visibility . Visible ;
572
+ }
573
+
574
+
557
575
if ( query . ActionKeyword == Plugin . Query . GlobalPluginWildcardSign )
558
576
{
559
577
// Wait 45 millisecond for query change in global query
You can’t perform that action at this time.
0 commit comments