mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Fix xaml convert issue and use icon loader for PluginActivationIcon
This commit is contained in:
parent
d8c07a5741
commit
c3c6126bab
2 changed files with 10 additions and 1 deletions
|
|
@ -308,7 +308,7 @@
|
|||
VerticalAlignment="Center"
|
||||
Panel.ZIndex="2"
|
||||
RenderOptions.BitmapScalingMode="HighQuality"
|
||||
Source="{Binding PluginIconPath}"
|
||||
Source="{Binding PluginIconSource}"
|
||||
Stretch="Uniform"
|
||||
Style="{DynamicResource PluginActivationIcon}" />
|
||||
<Canvas Style="{DynamicResource SearchIconPosition}">
|
||||
|
|
|
|||
|
|
@ -23,6 +23,8 @@ using CommunityToolkit.Mvvm.Input;
|
|||
using System.Globalization;
|
||||
using System.Windows.Input;
|
||||
using System.ComponentModel;
|
||||
using Flow.Launcher.Infrastructure.Image;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace Flow.Launcher.ViewModel
|
||||
{
|
||||
|
|
@ -722,6 +724,8 @@ namespace Flow.Launcher.ViewModel
|
|||
set => Settings.ResultSubItemFontSize = value;
|
||||
}
|
||||
|
||||
public ImageSource PluginIconSource { get; private set; } = null;
|
||||
|
||||
public string PluginIconPath { get; set; } = null;
|
||||
|
||||
public string OpenResultCommandModifiers => Settings.OpenResultModifiers;
|
||||
|
|
@ -1066,6 +1070,7 @@ namespace Flow.Launcher.ViewModel
|
|||
Results.Clear();
|
||||
Results.Visibility = Visibility.Collapsed;
|
||||
PluginIconPath = null;
|
||||
PluginIconSource = null;
|
||||
SearchIconVisibility = Visibility.Visible;
|
||||
return;
|
||||
}
|
||||
|
|
@ -1099,11 +1104,13 @@ namespace Flow.Launcher.ViewModel
|
|||
if (plugins.Count == 1)
|
||||
{
|
||||
PluginIconPath = plugins.Single().Metadata.IcoPath;
|
||||
PluginIconSource = await ImageLoader.LoadAsync(PluginIconPath);
|
||||
SearchIconVisibility = Visibility.Hidden;
|
||||
}
|
||||
else
|
||||
{
|
||||
PluginIconPath = null;
|
||||
PluginIconSource = null;
|
||||
SearchIconVisibility = Visibility.Visible;
|
||||
}
|
||||
|
||||
|
|
@ -1467,6 +1474,8 @@ namespace Flow.Launcher.ViewModel
|
|||
{
|
||||
Log.Debug("MainViewModel", $"Error in UpdateResultView: {ex.Message}");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
|
|||
Loading…
Reference in a new issue