Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Flow.Launcher.Core/Flow.Launcher.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Droplex" Version="1.4.0" />
<PackageReference Include="Droplex" Version="1.4.1" />
<PackageReference Include="FSharp.Core" Version="5.0.2" />
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="2.1.3" />
<PackageReference Include="squirrel.windows" Version="1.5.2" />
Expand Down
7 changes: 4 additions & 3 deletions Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ protected string Execute(ProcessStartInfo startInfo)
protected async Task<Stream> ExecuteAsync(ProcessStartInfo startInfo, CancellationToken token = default)
{
Process process = null;
bool disposed = false;
using var exitTokenSource = new CancellationTokenSource();
try
{
process = Process.Start(startInfo);
Expand All @@ -251,6 +251,7 @@ protected async Task<Stream> ExecuteAsync(ProcessStartInfo startInfo, Cancellati
return Stream.Null;
}


await using var source = process.StandardOutput.BaseStream;

var buffer = BufferManager.GetStream();
Expand All @@ -259,7 +260,7 @@ protected async Task<Stream> ExecuteAsync(ProcessStartInfo startInfo, Cancellati
{
// ReSharper disable once AccessToModifiedClosure
// Manually Check whether disposed
if (!disposed && !process.HasExited)
if (!exitTokenSource.IsCancellationRequested && !process.HasExited)
process.Kill();
});

Expand Down Expand Up @@ -302,8 +303,8 @@ protected async Task<Stream> ExecuteAsync(ProcessStartInfo startInfo, Cancellati
}
finally
{
exitTokenSource.Cancel();
process?.Dispose();
disposed = true;
}
}

Expand Down
2 changes: 1 addition & 1 deletion Flow.Launcher/Flow.Launcher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
<PackageReference Include="Microsoft.Toolkit.Uwp.Notifications" Version="7.1.2" />
<PackageReference Include="ModernWpfUI" Version="0.9.4" />
<PackageReference Include="NHotkey.Wpf" Version="2.1.0" />
<PackageReference Include="NuGet.CommandLine" Version="5.4.0">
<PackageReference Include="NuGet.CommandLine" Version="5.7.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion Flow.Launcher/Languages/en.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<system:String x:Key="shadowEffectNotAllowed">Shadow effect is not allowed while current theme has blur effect enabled</system:String>

<!-- Setting Plugin -->
<system:String x:Key="plugin">Plugins</system:String>
<system:String x:Key="plugin">Plugin</system:String>
<system:String x:Key="browserMorePlugins">Find more plugins</system:String>
<system:String x:Key="enable">On</system:String>
<system:String x:Key="disable">Off</system:String>
Expand Down
7 changes: 5 additions & 2 deletions Flow.Launcher/SettingWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,9 @@
ScrollViewer.CanContentScroll="False"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
SelectedItem="{Binding SelectedPlugin}"
SnapsToDevicePixels="True">
SelectionChanged="SelectedPluginChanged"
SnapsToDevicePixels="True"
Name="Plugins">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Margin="0,0,0,18" />
Expand Down Expand Up @@ -1116,7 +1118,8 @@
Margin="0"
Padding="1"
VerticalAlignment="Stretch"
Content="{Binding SettingControl}" />
Content="{Binding SettingControl}"
SizeChanged="ItemSizeChanged"/>
</StackPanel>

<StackPanel>
Expand Down
19 changes: 16 additions & 3 deletions Flow.Launcher/SettingWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@
using System;
using System.IO;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Forms;
using System.Windows.Input;
using System.Windows.Interop;
using System.Windows.Media;
using System.Windows.Navigation;
using Button = System.Windows.Controls.Button;
using Control = System.Windows.Controls.Control;
using ListViewItem = System.Windows.Controls.ListViewItem;
using MessageBox = System.Windows.MessageBox;
using TextBox = System.Windows.Controls.TextBox;
using ThemeManager = ModernWpf.ThemeManager;
Expand All @@ -44,6 +47,7 @@ public SettingWindow(IPublicAPI api, SettingWindowViewModel viewModel)
}

#region General

private void OnLoaded(object sender, RoutedEventArgs e)
{
RefreshMaximizeRestoreButton();
Expand Down Expand Up @@ -247,6 +251,7 @@ private void OnPluginDirecotyClick(object sender, MouseButtonEventArgs e)
PluginManager.API.OpenDirectory(directory);
}
}

#endregion

#region Proxy
Expand Down Expand Up @@ -307,7 +312,7 @@ private void OnPluginStoreRefreshClick(object sender, RoutedEventArgs e)

private void OnExternalPluginInstallClick(object sender, RoutedEventArgs e)
{
if(sender is Button { DataContext: UserPlugin plugin })
if (sender is Button { DataContext: UserPlugin plugin })
{
var pluginsManagerPlugin = PluginManager.GetPluginForId("9f8f9b14-2518-4907-b211-35ab6290dee7");
var actionKeyword = pluginsManagerPlugin.Metadata.ActionKeywords.Count == 0 ? "" : pluginsManagerPlugin.Metadata.ActionKeywords[0];
Expand All @@ -326,7 +331,7 @@ private void OnExternalPluginInstallClick(object sender, RoutedEventArgs e)
textBox.MoveFocus(tRequest);
}

private void ColorSchemeSelectedIndexChanged(object sender, EventArgs e)
private void ColorSchemeSelectedIndexChanged(object sender, EventArgs e)
=> ThemeManager.Current.ApplicationTheme = settings.ColorScheme switch
{
Constant.Light => ApplicationTheme.Light,
Expand Down Expand Up @@ -370,5 +375,13 @@ private void Window_StateChanged(object sender, EventArgs e)
RefreshMaximizeRestoreButton();
}

private void SelectedPluginChanged(object sender, SelectionChangedEventArgs e)
{
Plugins.ScrollIntoView(Plugins.SelectedItem);
}
private void ItemSizeChanged(object sender, SizeChangedEventArgs e)
{
Plugins.ScrollIntoView(Plugins.SelectedItem);
}
}
}
}
Loading