mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Merge branch 'Flow-Launcher:dev' into Allow10thResultHotkey
This commit is contained in:
commit
bfbaaebd19
6 changed files with 52 additions and 4 deletions
|
|
@ -66,6 +66,10 @@ namespace Flow.Launcher.Plugin
|
|||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Determines if Icon has a border radius
|
||||
/// </summary>
|
||||
public bool RoundedIcon { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Delegate function, see <see cref="Icon"/>
|
||||
|
|
|
|||
|
|
@ -79,6 +79,7 @@
|
|||
<system:String x:Key="plugin_query_time">Query time:</system:String>
|
||||
<system:String x:Key="plugin_query_version">| Version</system:String>
|
||||
<system:String x:Key="plugin_query_web">Website</system:String>
|
||||
<system:String x:Key="plugin_uninstall">Uninstall</system:String>
|
||||
|
||||
|
||||
<!-- Setting Plugin Store -->
|
||||
|
|
|
|||
|
|
@ -82,13 +82,17 @@
|
|||
BorderThickness="0">
|
||||
<Image
|
||||
x:Name="ImageIcon"
|
||||
Width="32"
|
||||
Height="32"
|
||||
Width="{Binding IconXY}"
|
||||
Height="{Binding IconXY}"
|
||||
Margin="0,0,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
Source="{Binding Image, TargetNullValue={x:Null}}"
|
||||
Stretch="Uniform"
|
||||
Visibility="{Binding ShowIcon}" />
|
||||
Visibility="{Binding ShowIcon}">
|
||||
<Image.Clip>
|
||||
<EllipseGeometry RadiusX="{Binding IconRadius}" RadiusY="{Binding IconRadius}" Center="16 16"/>
|
||||
</Image.Clip>
|
||||
</Image>
|
||||
</Border>
|
||||
<Border
|
||||
Margin="9,0,0,0"
|
||||
|
|
|
|||
|
|
@ -1207,6 +1207,17 @@
|
|||
</Hyperlink>
|
||||
</TextBlock>
|
||||
|
||||
<TextBlock
|
||||
Margin="10,0,0,0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Cursor="Hand"
|
||||
FontSize="11"
|
||||
Foreground="{DynamicResource PluginInfoColor}"
|
||||
MouseUp="OnExternalPluginUninstallClick"
|
||||
Text="{DynamicResource plugin_uninstall}"
|
||||
TextDecorations="Underline" />
|
||||
|
||||
<TextBlock
|
||||
Margin="10,0,0,0"
|
||||
HorizontalAlignment="Right"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using Flow.Launcher.Core.ExternalPlugins;
|
||||
using Droplex;
|
||||
using Flow.Launcher.Core.ExternalPlugins;
|
||||
using Flow.Launcher.Core.Plugin;
|
||||
using Flow.Launcher.Core.Resource;
|
||||
using Flow.Launcher.Helper;
|
||||
|
|
@ -348,5 +349,17 @@ namespace Flow.Launcher
|
|||
{
|
||||
Plugins.ScrollIntoView(Plugins.SelectedItem);
|
||||
}
|
||||
|
||||
private void OnExternalPluginUninstallClick(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (e.ChangedButton == MouseButton.Left)
|
||||
{
|
||||
var id = viewModel.SelectedPlugin.PluginPair.Metadata.Name;
|
||||
var pluginsManagerPlugin = PluginManager.GetPluginForId("9f8f9b14-2518-4907-b211-35ab6290dee7");
|
||||
var actionKeyword = pluginsManagerPlugin.Metadata.ActionKeywords.Count == 0 ? "" : pluginsManagerPlugin.Metadata.ActionKeywords[0];
|
||||
API.ChangeQuery($"{actionKeyword} uninstall {id}");
|
||||
API.ShowMainWindow();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,6 +84,19 @@ namespace Flow.Launcher.ViewModel
|
|||
}
|
||||
}
|
||||
|
||||
public double IconRadius
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Result.RoundedIcon)
|
||||
{
|
||||
return IconXY / 2;
|
||||
}
|
||||
return IconXY;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public Visibility ShowGlyph
|
||||
{
|
||||
get
|
||||
|
|
@ -175,6 +188,8 @@ namespace Flow.Launcher.ViewModel
|
|||
|
||||
public string QuerySuggestionText { get; set; }
|
||||
|
||||
public double IconXY { get; set; } = 32;
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
return obj is ResultViewModel r && Result.Equals(r.Result);
|
||||
|
|
|
|||
Loading…
Reference in a new issue