Skip to content

Commit c3c6126

Browse files
committed
Fix xaml convert issue and use icon loader for PluginActivationIcon
1 parent d8c07a5 commit c3c6126

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

Flow.Launcher/MainWindow.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@
308308
VerticalAlignment="Center"
309309
Panel.ZIndex="2"
310310
RenderOptions.BitmapScalingMode="HighQuality"
311-
Source="{Binding PluginIconPath}"
311+
Source="{Binding PluginIconSource}"
312312
Stretch="Uniform"
313313
Style="{DynamicResource PluginActivationIcon}" />
314314
<Canvas Style="{DynamicResource SearchIconPosition}">

Flow.Launcher/ViewModel/MainViewModel.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
using System.Globalization;
2424
using System.Windows.Input;
2525
using System.ComponentModel;
26+
using Flow.Launcher.Infrastructure.Image;
27+
using System.Windows.Media;
2628

2729
namespace Flow.Launcher.ViewModel
2830
{
@@ -722,6 +724,8 @@ public double ResultSubItemFontSize
722724
set => Settings.ResultSubItemFontSize = value;
723725
}
724726

727+
public ImageSource PluginIconSource { get; private set; } = null;
728+
725729
public string PluginIconPath { get; set; } = null;
726730

727731
public string OpenResultCommandModifiers => Settings.OpenResultModifiers;
@@ -1066,6 +1070,7 @@ private async void QueryResults(bool isReQuery = false, bool reSelect = true)
10661070
Results.Clear();
10671071
Results.Visibility = Visibility.Collapsed;
10681072
PluginIconPath = null;
1073+
PluginIconSource = null;
10691074
SearchIconVisibility = Visibility.Visible;
10701075
return;
10711076
}
@@ -1099,11 +1104,13 @@ private async void QueryResults(bool isReQuery = false, bool reSelect = true)
10991104
if (plugins.Count == 1)
11001105
{
11011106
PluginIconPath = plugins.Single().Metadata.IcoPath;
1107+
PluginIconSource = await ImageLoader.LoadAsync(PluginIconPath);
11021108
SearchIconVisibility = Visibility.Hidden;
11031109
}
11041110
else
11051111
{
11061112
PluginIconPath = null;
1113+
PluginIconSource = null;
11071114
SearchIconVisibility = Visibility.Visible;
11081115
}
11091116

@@ -1467,6 +1474,8 @@ public void UpdateResultView(ICollection<ResultsForUpdate> resultsForUpdates)
14671474
{
14681475
Log.Debug("MainViewModel", $"Error in UpdateResultView: {ex.Message}");
14691476
}
1477+
1478+
14701479
}
14711480

14721481
#endregion

0 commit comments

Comments
 (0)