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"
|
VerticalAlignment="Center"
|
||||||
Panel.ZIndex="2"
|
Panel.ZIndex="2"
|
||||||
RenderOptions.BitmapScalingMode="HighQuality"
|
RenderOptions.BitmapScalingMode="HighQuality"
|
||||||
Source="{Binding PluginIconPath}"
|
Source="{Binding PluginIconSource}"
|
||||||
Stretch="Uniform"
|
Stretch="Uniform"
|
||||||
Style="{DynamicResource PluginActivationIcon}" />
|
Style="{DynamicResource PluginActivationIcon}" />
|
||||||
<Canvas Style="{DynamicResource SearchIconPosition}">
|
<Canvas Style="{DynamicResource SearchIconPosition}">
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,8 @@ using CommunityToolkit.Mvvm.Input;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
|
using Flow.Launcher.Infrastructure.Image;
|
||||||
|
using System.Windows.Media;
|
||||||
|
|
||||||
namespace Flow.Launcher.ViewModel
|
namespace Flow.Launcher.ViewModel
|
||||||
{
|
{
|
||||||
|
|
@ -722,6 +724,8 @@ namespace Flow.Launcher.ViewModel
|
||||||
set => Settings.ResultSubItemFontSize = value;
|
set => Settings.ResultSubItemFontSize = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ImageSource PluginIconSource { get; private set; } = null;
|
||||||
|
|
||||||
public string PluginIconPath { get; set; } = null;
|
public string PluginIconPath { get; set; } = null;
|
||||||
|
|
||||||
public string OpenResultCommandModifiers => Settings.OpenResultModifiers;
|
public string OpenResultCommandModifiers => Settings.OpenResultModifiers;
|
||||||
|
|
@ -1066,6 +1070,7 @@ namespace Flow.Launcher.ViewModel
|
||||||
Results.Clear();
|
Results.Clear();
|
||||||
Results.Visibility = Visibility.Collapsed;
|
Results.Visibility = Visibility.Collapsed;
|
||||||
PluginIconPath = null;
|
PluginIconPath = null;
|
||||||
|
PluginIconSource = null;
|
||||||
SearchIconVisibility = Visibility.Visible;
|
SearchIconVisibility = Visibility.Visible;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -1099,11 +1104,13 @@ namespace Flow.Launcher.ViewModel
|
||||||
if (plugins.Count == 1)
|
if (plugins.Count == 1)
|
||||||
{
|
{
|
||||||
PluginIconPath = plugins.Single().Metadata.IcoPath;
|
PluginIconPath = plugins.Single().Metadata.IcoPath;
|
||||||
|
PluginIconSource = await ImageLoader.LoadAsync(PluginIconPath);
|
||||||
SearchIconVisibility = Visibility.Hidden;
|
SearchIconVisibility = Visibility.Hidden;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
PluginIconPath = null;
|
PluginIconPath = null;
|
||||||
|
PluginIconSource = null;
|
||||||
SearchIconVisibility = Visibility.Visible;
|
SearchIconVisibility = Visibility.Visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1467,6 +1474,8 @@ namespace Flow.Launcher.ViewModel
|
||||||
{
|
{
|
||||||
Log.Debug("MainViewModel", $"Error in UpdateResultView: {ex.Message}");
|
Log.Debug("MainViewModel", $"Error in UpdateResultView: {ex.Message}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue