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>
|
/// <summary>
|
||||||
/// Delegate function, see <see cref="Icon"/>
|
/// 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_time">Query time:</system:String>
|
||||||
<system:String x:Key="plugin_query_version">| Version</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_query_web">Website</system:String>
|
||||||
|
<system:String x:Key="plugin_uninstall">Uninstall</system:String>
|
||||||
|
|
||||||
|
|
||||||
<!-- Setting Plugin Store -->
|
<!-- Setting Plugin Store -->
|
||||||
|
|
|
||||||
|
|
@ -82,13 +82,17 @@
|
||||||
BorderThickness="0">
|
BorderThickness="0">
|
||||||
<Image
|
<Image
|
||||||
x:Name="ImageIcon"
|
x:Name="ImageIcon"
|
||||||
Width="32"
|
Width="{Binding IconXY}"
|
||||||
Height="32"
|
Height="{Binding IconXY}"
|
||||||
Margin="0,0,0,0"
|
Margin="0,0,0,0"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
Source="{Binding Image, TargetNullValue={x:Null}}"
|
Source="{Binding Image, TargetNullValue={x:Null}}"
|
||||||
Stretch="Uniform"
|
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>
|
||||||
<Border
|
<Border
|
||||||
Margin="9,0,0,0"
|
Margin="9,0,0,0"
|
||||||
|
|
|
||||||
|
|
@ -1207,6 +1207,17 @@
|
||||||
</Hyperlink>
|
</Hyperlink>
|
||||||
</TextBlock>
|
</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
|
<TextBlock
|
||||||
Margin="10,0,0,0"
|
Margin="10,0,0,0"
|
||||||
HorizontalAlignment="Right"
|
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.Plugin;
|
||||||
using Flow.Launcher.Core.Resource;
|
using Flow.Launcher.Core.Resource;
|
||||||
using Flow.Launcher.Helper;
|
using Flow.Launcher.Helper;
|
||||||
|
|
@ -348,5 +349,17 @@ namespace Flow.Launcher
|
||||||
{
|
{
|
||||||
Plugins.ScrollIntoView(Plugins.SelectedItem);
|
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
|
public Visibility ShowGlyph
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|
@ -175,6 +188,8 @@ namespace Flow.Launcher.ViewModel
|
||||||
|
|
||||||
public string QuerySuggestionText { get; set; }
|
public string QuerySuggestionText { get; set; }
|
||||||
|
|
||||||
|
public double IconXY { get; set; } = 32;
|
||||||
|
|
||||||
public override bool Equals(object obj)
|
public override bool Equals(object obj)
|
||||||
{
|
{
|
||||||
return obj is ResultViewModel r && Result.Equals(r.Result);
|
return obj is ResultViewModel r && Result.Equals(r.Result);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue