Skip to content

Commit bfbaaeb

Browse files
Merge branch 'Flow-Launcher:dev' into Allow10thResultHotkey
2 parents 28ff6ac + a200ada commit bfbaaeb

File tree

6 files changed

+52
-4
lines changed

6 files changed

+52
-4
lines changed

Flow.Launcher.Plugin/Result.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ public string IcoPath
6666
}
6767
}
6868
}
69+
/// <summary>
70+
/// Determines if Icon has a border radius
71+
/// </summary>
72+
public bool RoundedIcon { get; set; } = false;
6973

7074
/// <summary>
7175
/// Delegate function, see <see cref="Icon"/>

Flow.Launcher/Languages/en.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
<system:String x:Key="plugin_query_time">Query time:</system:String>
8080
<system:String x:Key="plugin_query_version">| Version</system:String>
8181
<system:String x:Key="plugin_query_web">Website</system:String>
82+
<system:String x:Key="plugin_uninstall">Uninstall</system:String>
8283

8384

8485
<!-- Setting Plugin Store -->

Flow.Launcher/ResultListBox.xaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,17 @@
8282
BorderThickness="0">
8383
<Image
8484
x:Name="ImageIcon"
85-
Width="32"
86-
Height="32"
85+
Width="{Binding IconXY}"
86+
Height="{Binding IconXY}"
8787
Margin="0,0,0,0"
8888
HorizontalAlignment="Center"
8989
Source="{Binding Image, TargetNullValue={x:Null}}"
9090
Stretch="Uniform"
91-
Visibility="{Binding ShowIcon}" />
91+
Visibility="{Binding ShowIcon}">
92+
<Image.Clip>
93+
<EllipseGeometry RadiusX="{Binding IconRadius}" RadiusY="{Binding IconRadius}" Center="16 16"/>
94+
</Image.Clip>
95+
</Image>
9296
</Border>
9397
<Border
9498
Margin="9,0,0,0"

Flow.Launcher/SettingWindow.xaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,6 +1207,17 @@
12071207
</Hyperlink>
12081208
</TextBlock>
12091209

1210+
<TextBlock
1211+
Margin="10,0,0,0"
1212+
HorizontalAlignment="Right"
1213+
VerticalAlignment="Center"
1214+
Cursor="Hand"
1215+
FontSize="11"
1216+
Foreground="{DynamicResource PluginInfoColor}"
1217+
MouseUp="OnExternalPluginUninstallClick"
1218+
Text="{DynamicResource plugin_uninstall}"
1219+
TextDecorations="Underline" />
1220+
12101221
<TextBlock
12111222
Margin="10,0,0,0"
12121223
HorizontalAlignment="Right"

Flow.Launcher/SettingWindow.xaml.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using Flow.Launcher.Core.ExternalPlugins;
1+
using Droplex;
2+
using Flow.Launcher.Core.ExternalPlugins;
23
using Flow.Launcher.Core.Plugin;
34
using Flow.Launcher.Core.Resource;
45
using Flow.Launcher.Helper;
@@ -348,5 +349,17 @@ private void ItemSizeChanged(object sender, SizeChangedEventArgs e)
348349
{
349350
Plugins.ScrollIntoView(Plugins.SelectedItem);
350351
}
352+
353+
private void OnExternalPluginUninstallClick(object sender, MouseButtonEventArgs e)
354+
{
355+
if (e.ChangedButton == MouseButton.Left)
356+
{
357+
var id = viewModel.SelectedPlugin.PluginPair.Metadata.Name;
358+
var pluginsManagerPlugin = PluginManager.GetPluginForId("9f8f9b14-2518-4907-b211-35ab6290dee7");
359+
var actionKeyword = pluginsManagerPlugin.Metadata.ActionKeywords.Count == 0 ? "" : pluginsManagerPlugin.Metadata.ActionKeywords[0];
360+
API.ChangeQuery($"{actionKeyword} uninstall {id}");
361+
API.ShowMainWindow();
362+
}
363+
}
351364
}
352365
}

Flow.Launcher/ViewModel/ResultViewModel.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,19 @@ public Visibility ShowIcon
8484
}
8585
}
8686

87+
public double IconRadius
88+
{
89+
get
90+
{
91+
if (Result.RoundedIcon)
92+
{
93+
return IconXY / 2;
94+
}
95+
return IconXY;
96+
}
97+
98+
}
99+
87100
public Visibility ShowGlyph
88101
{
89102
get
@@ -175,6 +188,8 @@ public int ResultProgress
175188

176189
public string QuerySuggestionText { get; set; }
177190

191+
public double IconXY { get; set; } = 32;
192+
178193
public override bool Equals(object obj)
179194
{
180195
return obj is ResultViewModel r && Result.Equals(r.Result);

0 commit comments

Comments
 (0)