|
23 | 23 | using System.Globalization;
|
24 | 24 | using System.Windows.Input;
|
25 | 25 | using System.ComponentModel;
|
| 26 | +using Flow.Launcher.Infrastructure.Image; |
| 27 | +using System.Windows.Media; |
26 | 28 |
|
27 | 29 | namespace Flow.Launcher.ViewModel
|
28 | 30 | {
|
@@ -722,6 +724,8 @@ public double ResultSubItemFontSize
|
722 | 724 | set => Settings.ResultSubItemFontSize = value;
|
723 | 725 | }
|
724 | 726 |
|
| 727 | + public ImageSource PluginIconSource { get; private set; } = null; |
| 728 | + |
725 | 729 | public string PluginIconPath { get; set; } = null;
|
726 | 730 |
|
727 | 731 | public string OpenResultCommandModifiers => Settings.OpenResultModifiers;
|
@@ -1066,6 +1070,7 @@ private async void QueryResults(bool isReQuery = false, bool reSelect = true)
|
1066 | 1070 | Results.Clear();
|
1067 | 1071 | Results.Visibility = Visibility.Collapsed;
|
1068 | 1072 | PluginIconPath = null;
|
| 1073 | + PluginIconSource = null; |
1069 | 1074 | SearchIconVisibility = Visibility.Visible;
|
1070 | 1075 | return;
|
1071 | 1076 | }
|
@@ -1099,11 +1104,13 @@ private async void QueryResults(bool isReQuery = false, bool reSelect = true)
|
1099 | 1104 | if (plugins.Count == 1)
|
1100 | 1105 | {
|
1101 | 1106 | PluginIconPath = plugins.Single().Metadata.IcoPath;
|
| 1107 | + PluginIconSource = await ImageLoader.LoadAsync(PluginIconPath); |
1102 | 1108 | SearchIconVisibility = Visibility.Hidden;
|
1103 | 1109 | }
|
1104 | 1110 | else
|
1105 | 1111 | {
|
1106 | 1112 | PluginIconPath = null;
|
| 1113 | + PluginIconSource = null; |
1107 | 1114 | SearchIconVisibility = Visibility.Visible;
|
1108 | 1115 | }
|
1109 | 1116 |
|
@@ -1467,6 +1474,8 @@ public void UpdateResultView(ICollection<ResultsForUpdate> resultsForUpdates)
|
1467 | 1474 | {
|
1468 | 1475 | Log.Debug("MainViewModel", $"Error in UpdateResultView: {ex.Message}");
|
1469 | 1476 | }
|
| 1477 | + |
| 1478 | + |
1470 | 1479 | }
|
1471 | 1480 |
|
1472 | 1481 | #endregion
|
|
0 commit comments