Merge branch 'dev' into Shortcut

This commit is contained in:
Kevin Zhang 2022-06-04 00:30:56 -05:00 committed by GitHub
commit 8ebdff0873
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 262 additions and 202 deletions

23
.github/workflows/stale.yml vendored Normal file
View file

@ -0,0 +1,23 @@
# For more information, see:
# https://github.com/actions/stale
name: Mark stale issues and pull requests
on:
schedule:
- cron: '30 1 * * *'
jobs:
stale:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v4
with:
stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.'
days-before-stale: 30
days-before-close: 5
days-before-pr-close: -1
exempt-all-milestones: true
close-issue-message: 'This issue was closed because it has been stale for 5 days with no activity. If you feel this issue still needs attention please feel free to reopen.'

View file

@ -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" />

View file

@ -15,20 +15,6 @@ namespace Flow.Launcher.Core.Plugin
private readonly AssemblyName assemblyName;
private static readonly ConcurrentDictionary<string, byte> loadedAssembly;
static PluginAssemblyLoader()
{
var currentAssemblies = AppDomain.CurrentDomain.GetAssemblies();
loadedAssembly = new ConcurrentDictionary<string, byte>(
currentAssemblies.Select(x => new KeyValuePair<string, byte>(x.FullName, default)));
AppDomain.CurrentDomain.AssemblyLoad += (sender, args) =>
{
loadedAssembly[args.LoadedAssembly.FullName] = default;
};
}
internal PluginAssemblyLoader(string assemblyFilePath)
{
dependencyResolver = new AssemblyDependencyResolver(assemblyFilePath);
@ -47,10 +33,9 @@ namespace Flow.Launcher.Core.Plugin
// When resolving dependencies, ignore assembly depenedencies that already exits with Flow.Launcher
// Otherwise duplicate assembly will be loaded and some weird behavior will occur, such as WinRT.Runtime.dll
// will fail due to loading multiple versions in process, each with their own static instance of registration state
if (assemblyPath == null || ExistsInReferencedPackage(assemblyName))
return null;
var existAssembly = Default.Assemblies.FirstOrDefault(x => x.FullName == assemblyName.FullName);
return LoadFromAssemblyPath(assemblyPath);
return existAssembly ?? (assemblyPath == null ? null : LoadFromAssemblyPath(assemblyPath));
}
internal Type FromAssemblyGetTypeOfInterface(Assembly assembly, Type type)
@ -58,10 +43,5 @@ namespace Flow.Launcher.Core.Plugin
var allTypes = assembly.ExportedTypes;
return allTypes.First(o => o.IsClass && !o.IsAbstract && o.GetInterfaces().Any(t => t == type));
}
internal bool ExistsInReferencedPackage(AssemblyName assemblyName)
{
return loadedAssembly.ContainsKey(assemblyName.FullName);
}
}
}

View file

@ -19,6 +19,8 @@ namespace Flow.Launcher.Core.Resource
public static Language Serbian = new Language("sr", "Srpski");
public static Language Portuguese_Portugal = new Language("pt-pt", "Português");
public static Language Portuguese_Brazil = new Language("pt-br", "Português (Brasil)");
public static Language Spanish = new Language("es", "Spanish");
public static Language Spanish_LatinAmerica = new Language("es-419", "Spanish (Latin America)");
public static Language Italian = new Language("it", "Italiano");
public static Language Norwegian_Bokmal = new Language("nb-NO", "Norsk Bokmål");
public static Language Slovak = new Language("sk", "Slovenský");
@ -43,6 +45,8 @@ namespace Flow.Launcher.Core.Resource
Serbian,
Portuguese_Portugal,
Portuguese_Brazil,
Spanish,
Spanish_LatinAmerica,
Italian,
Norwegian_Bokmal,
Slovak,

View file

@ -228,12 +228,26 @@ namespace Flow.Launcher.Plugin
public void OpenDirectory(string DirectoryPath, string FileName = null);
/// <summary>
/// Opens the url. The browser and mode used is based on what's configured in Flow's default browser settings.
/// Opens the URL with the given Uri object.
/// The browser and mode used is based on what's configured in Flow's default browser settings.
/// </summary>
public void OpenUrl(Uri url, bool? inPrivate = null);
/// <summary>
/// Opens the URL with the given string.
/// The browser and mode used is based on what's configured in Flow's default browser settings.
/// Non-C# plugins should use this method.
/// </summary>
public void OpenUrl(string url, bool? inPrivate = null);
/// <summary>
/// Opens the application URI.
/// Opens the application URI with the given Uri object, e.g. obsidian://search-query-example
/// </summary>
public void OpenAppUri(Uri appUri);
/// <summary>
/// Opens the application URI with the given string, e.g. obsidian://search-query-example
/// Non-C# plugins should use this method
/// </summary>
public void OpenAppUri(string appUri);
}

View file

@ -25,7 +25,7 @@ namespace Flow.Launcher.Helper
internal static void OnToggleHotkey(object sender, HotkeyEventArgs args)
{
if (!mainViewModel.GameModeStatus)
if (!mainViewModel.ShouldIgnoreHotkeys() && !mainViewModel.GameModeStatus)
mainViewModel.ToggleFlowLauncher();
}

View file

@ -58,7 +58,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>

View file

@ -209,9 +209,8 @@ namespace Flow.Launcher
explorer.Start();
}
public void OpenUri(string url, bool? inPrivate = null, bool isAppUri = false)
private void OpenUri(Uri uri, bool? inPrivate = null)
{
var uri = new Uri(url);
if (uri.Scheme == Uri.UriSchemeHttp || uri.Scheme == Uri.UriSchemeHttps)
{
var browserInfo = _settingsVM.Settings.CustomBrowser;
@ -220,38 +219,43 @@ namespace Flow.Launcher
if (browserInfo.OpenInTab)
{
url.OpenInBrowserTab(path, inPrivate ?? browserInfo.EnablePrivate, browserInfo.PrivateArg);
uri.AbsoluteUri.OpenInBrowserTab(path, inPrivate ?? browserInfo.EnablePrivate, browserInfo.PrivateArg);
}
else
{
url.OpenInBrowserWindow(path, inPrivate ?? browserInfo.EnablePrivate, browserInfo.PrivateArg);
uri.AbsoluteUri.OpenInBrowserWindow(path, inPrivate ?? browserInfo.EnablePrivate, browserInfo.PrivateArg);
}
return;
}
if (isAppUri)
else
{
Process.Start(new ProcessStartInfo()
{
FileName = url,
FileName = uri.AbsoluteUri,
UseShellExecute = true
})?.Dispose();
return;
}
throw new InvalidOperationException("URI scheme not specified or supported ");
}
public void OpenUrl(string url, bool? inPrivate = null)
{
OpenUri(new Uri(url), inPrivate);
}
public void OpenUrl(Uri url, bool? inPrivate = null)
{
OpenUri(url, inPrivate);
}
public void OpenAppUri(string appUri)
{
OpenUri(appUri, isAppUri: true);
OpenUri(new Uri(appUri));
}
public void OpenAppUri(Uri appUri)
{
OpenUri(appUri);
}
public event FlowLauncherGlobalKeyboardEventHandler GlobalKeyboardEvent;

View file

@ -1,15 +1,16 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:userSettings="clr-namespace:Flow.Launcher.Infrastructure.UserSettings;assembly=Flow.Launcher.Infrastructure">
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:userSettings="clr-namespace:Flow.Launcher.Infrastructure.UserSettings;assembly=Flow.Launcher.Infrastructure">
<!-- Further font customisations are dynamically loaded in Theme.cs -->
<!-- Further font customisations are dynamically loaded in Theme.cs -->
<Style x:Key="BaseQueryBoxStyle" TargetType="{x:Type TextBox}">
<Setter Property="BorderThickness" Value="0" />
<Setter Property="FontSize" Value="28" />
<Setter Property="FontWeight" Value="Regular" />
<Setter Property="Margin" Value="16 7 0 7" />
<Setter Property="Padding" Value="0 4 68 0" />
<Setter Property="Margin" Value="16,7,0,7" />
<Setter Property="Padding" Value="0,4,68,0" />
<Setter Property="Background" Value="#2F2F2F" />
<Setter Property="Height" Value="48" />
<Setter Property="Foreground" Value="#E3E0E3" />
@ -20,13 +21,22 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TextBox}">
<Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
<ScrollViewer x:Name="PART_ContentHost" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"
Background="{TemplateBinding Background}">
<Border
x:Name="border"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
SnapsToDevicePixels="True">
<ScrollViewer
x:Name="PART_ContentHost"
Background="{TemplateBinding Background}"
Focusable="false"
HorizontalScrollBarVisibility="Hidden"
VerticalScrollBarVisibility="Hidden">
<ScrollViewer.ContentTemplate>
<DataTemplate>
<Grid Background="{Binding Background, ElementName=PART_ContentHost}" RenderOptions.ClearTypeHint="Enabled">
<ContentPresenter Content="{Binding Path=Content, ElementName=PART_ContentHost}"></ContentPresenter>
<Grid Background="{Binding Background, ElementName=PART_ContentHost}">
<ContentPresenter Content="{Binding Path=Content, ElementName=PART_ContentHost}" />
</Grid>
</DataTemplate>
</ScrollViewer.ContentTemplate>
@ -37,47 +47,47 @@
</Setter>
</Style>
<!-- Further font customisations are dynamically loaded in Theme.cs -->
<Style x:Key="BaseQuerySuggestionBoxStyle" BasedOn="{StaticResource BaseQueryBoxStyle}" TargetType="{x:Type TextBox}">
<!-- Further font customisations are dynamically loaded in Theme.cs -->
<Style
x:Key="BaseQuerySuggestionBoxStyle"
BasedOn="{StaticResource BaseQueryBoxStyle}"
TargetType="{x:Type TextBox}">
<Setter Property="Foreground" Value="DarkGray" />
<Setter Property="Height" Value="48" />
<Setter Property="Margin" Value="16 7 0 7" />
<Setter Property="Margin" Value="16,7,0,7" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Padding" Value="0 4 68 0" />
<Setter Property="Padding" Value="0,4,68,0" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
<Style x:Key="BaseWindowBorderStyle" TargetType="{x:Type Border}">
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Background" Value="#2F2F2F"></Setter>
<Setter Property="Padding" Value="0 0 0 0" />
<Setter Property="Background" Value="#2F2F2F" />
<Setter Property="Padding" Value="0,0,0,0" />
<Setter Property="CornerRadius" Value="5" />
</Style>
<Style x:Key="BaseWindowStyle" TargetType="{x:Type Window}">
<Setter Property="Width" Value="600" />
<Setter Property="RenderOptions.ClearTypeHint" Value="Enabled"/>
</Style>
<Style x:Key="WindowRadius" TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="5" />
</Style>
<Style x:Key="BasePendingLineStyle" TargetType="{x:Type Line}">
<Setter Property="Stroke" Value="Blue" />
</Style>
<!-- Item Style -->
<!-- Item Style -->
<Style x:Key="BaseItemTitleStyle" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#FFFFF8" />
<Setter Property="FontSize" Value="16" />
<Setter Property="FontWeight" Value="Medium" />
<Setter Property="RenderOptions.ClearTypeHint" Value="Enabled"/>
</Style>
<Style x:Key="BaseItemSubTitleStyle" TargetType="{x:Type TextBlock}" >
<Style x:Key="BaseItemSubTitleStyle" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#D9D9D4" />
<Setter Property="RenderOptions.ClearTypeHint" Value="Enabled"/>
<Setter Property="FontSize" Value="13" />
<Setter Property="FontWeight" Value="Normal" />
<Style.Triggers>
@ -89,9 +99,8 @@
<Style x:Key="BaseItemNumberStyle" TargetType="{x:Type TextBlock}">
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="Margin" Value="3 0 0 0" />
<Setter Property="Margin" Value="3,0,0,0" />
<Setter Property="FontSize" Value="22" />
<Setter Property="RenderOptions.ClearTypeHint" Value="Enabled"/>
</Style>
<Style x:Key="BaseGlyphStyle" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#ffffff" />
@ -99,34 +108,31 @@
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="Width" Value="25" />
<Setter Property="Height" Value="25" />
<Setter Property="FontSize" Value="25"/>
<Setter Property="FontSize" Value="25" />
</Style>
<Style x:Key="BaseItemTitleSelectedStyle" TargetType="{x:Type TextBlock}" >
<Style x:Key="BaseItemTitleSelectedStyle" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#FFFFF8" />
<Setter Property="FontSize" Value="16" />
<Setter Property="FontWeight" Value="Normal" />
<Setter Property="RenderOptions.ClearTypeHint" Value="Enabled"/>
</Style>
<Style x:Key="BaseItemSubTitleSelectedStyle" TargetType="{x:Type TextBlock}" >
<Style x:Key="BaseItemSubTitleSelectedStyle" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#D9D9D4" />
<Setter Property="FontSize" Value="13" />
<Setter Property="RenderOptions.ClearTypeHint" Value="Enabled"/>
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=SubTitle, UpdateSourceTrigger=PropertyChanged, Path=Text.Length}" Value="0">
<Setter Property="Height" Value="0" />
</DataTrigger>
</Style.Triggers>
</Style>
<Style x:Key="BaseItemImageSelectedStyle" TargetType="{x:Type Image}" >
</Style>
<Style x:Key="BaseItemImageSelectedStyle" TargetType="{x:Type Image}" />
<Style x:Key="BaseListboxStyle" TargetType="{x:Type ListBox}">
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled"/>
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
<Setter Property="Margin" Value="0 0 0 0" />
<Setter Property="Padding" Value="0 0 0 0" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" />
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
<Setter Property="Margin" Value="0,0,0,0" />
<Setter Property="Padding" Value="0,0,0,0" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBox">
@ -135,12 +141,12 @@
<Style TargetType="ScrollViewer">
<Style.Triggers>
<Trigger Property="ComputedVerticalScrollBarVisibility" Value="Visible">
<Setter Property="Margin" Value="0 0 0 0" />
<Setter Property="Padding" Value="0 0 0 0" />
<Setter Property="Margin" Value="0,0,0,0" />
<Setter Property="Padding" Value="0,0,0,0" />
</Trigger>
<Trigger Property="ComputedVerticalScrollBarVisibility" Value="Collapsed">
<Setter Property="Margin" Value="0 0 0 0" />
<Setter Property="Padding" Value="0 0 0 0" />
<Setter Property="Margin" Value="0,0,0,0" />
<Setter Property="Padding" Value="0,0,0,0" />
</Trigger>
</Style.Triggers>
</Style>
@ -152,7 +158,7 @@
</Setter>
</Style>
<!-- ScrollViewer Style -->
<!-- ScrollViewer Style -->
<ControlTemplate x:Key="ScrollViewerControlTemplate" TargetType="{x:Type ScrollViewer}">
<Grid x:Name="Grid" Background="{TemplateBinding Background}">
<Grid.ColumnDefinitions>
@ -160,44 +166,50 @@
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<!--content in the left of ScrollViewer, just default-->
<ScrollContentPresenter x:Name="PART_ScrollContentPresenter"
CanContentScroll="{TemplateBinding CanContentScroll}"
CanHorizontallyScroll="False"
CanVerticallyScroll="False"
ContentTemplate="{TemplateBinding ContentTemplate}"
Content="{TemplateBinding Content}"
Grid.Column="0"
Margin="0"
Grid.Row="0" />
<!-- content in the left of ScrollViewer, just default -->
<ScrollContentPresenter
x:Name="PART_ScrollContentPresenter"
Grid.Row="0"
Grid.Column="0"
Margin="0"
CanContentScroll="{TemplateBinding CanContentScroll}"
CanHorizontallyScroll="False"
CanVerticallyScroll="False"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}" />
<!--Scrollbar in thr rigth of ScrollViewer-->
<ScrollBar x:Name="PART_VerticalScrollBar"
AutomationProperties.AutomationId="VerticalScrollBar"
Cursor="Arrow"
Grid.Column="0"
HorizontalAlignment="Right"
Margin="0 0 0 0"
Maximum="{TemplateBinding ScrollableHeight}"
Minimum="0"
Grid.Row="0"
Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"
ViewportSize="{TemplateBinding ViewportHeight}"
Style="{DynamicResource ScrollBarStyle}" />
<!-- Scrollbar in thr rigth of ScrollViewer -->
<ScrollBar
x:Name="PART_VerticalScrollBar"
Grid.Row="0"
Grid.Column="0"
Margin="0,0,0,0"
HorizontalAlignment="Right"
AutomationProperties.AutomationId="VerticalScrollBar"
Cursor="Arrow"
Maximum="{TemplateBinding ScrollableHeight}"
Minimum="0"
Style="{DynamicResource ScrollBarStyle}"
ViewportSize="{TemplateBinding ViewportHeight}"
Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" />
</Grid>
</ControlTemplate>
<!-- button style in the middle of the scrollbar -->
<!-- button style in the middle of the scrollbar -->
<Style x:Key="BaseThumbStyle" TargetType="{x:Type Thumb}">
<Setter Property="SnapsToDevicePixels" Value="True"/>
<Setter Property="OverridesDefaultStyle" Value="true"/>
<Setter Property="IsTabStop" Value="false"/>
<Setter Property="Focusable" Value="false"/>
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="OverridesDefaultStyle" Value="true" />
<Setter Property="IsTabStop" Value="false" />
<Setter Property="Focusable" Value="false" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Thumb}">
<Border CornerRadius="2" DockPanel.Dock="Right" Background="#898989" BorderBrush="Transparent" />
<Border
Background="#898989"
BorderBrush="Transparent"
CornerRadius="2"
DockPanel.Dock="Right" />
</ControlTemplate>
</Setter.Value>
</Setter>
@ -207,16 +219,19 @@
<Setter Property="Stylus.IsPressAndHoldEnabled" Value="false" />
<Setter Property="Stylus.IsFlicksEnabled" Value="false" />
<Setter Property="Background" Value="Black" />
<!-- must set min width -->
<Setter Property="MinWidth" Value="0"/>
<Setter Property="Width" Value="5"/>
<!-- must set min width -->
<Setter Property="MinWidth" Value="0" />
<Setter Property="Width" Value="5" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ScrollBar}">
<DockPanel>
<Track x:Name="PART_Track" IsDirectionReversed="true" DockPanel.Dock="Right">
<Track
x:Name="PART_Track"
DockPanel.Dock="Right"
IsDirectionReversed="true">
<Track.Thumb>
<Thumb Style="{DynamicResource ThumbStyle}"/>
<Thumb Style="{DynamicResource ThumbStyle}" />
</Track.Thumb>
</Track>
</DockPanel>
@ -224,8 +239,7 @@
</Setter.Value>
</Setter>
</Style>
<Style x:Key="BaseSeparatorStyle" TargetType="Rectangle">
</Style>
<Style x:Key="BaseSeparatorStyle" TargetType="Rectangle" />
<Style x:Key="HighlightStyle">
<Setter Property="Inline.FontWeight" Value="Bold" />
</Style>
@ -249,12 +263,12 @@
<Style x:Key="BaseSearchIconPosition" TargetType="{x:Type Canvas}">
<Setter Property="Width" Value="32" />
<Setter Property="Height" Value="32" />
<Setter Property="Margin" Value="0 2 18 0" />
<Setter Property="Margin" Value="0,2,18,0" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="HorizontalAlignment" Value="Right" />
</Style>
<!--for classic themes-->
<!-- for classic themes -->
<Style x:Key="SearchIconStyle" TargetType="{x:Type Path}">
<Setter Property="Fill" Value="#555555" />
<Setter Property="Width" Value="32" />
@ -263,19 +277,24 @@
<Style x:Key="SearchIconPosition" TargetType="{x:Type Canvas}">
<Setter Property="Width" Value="32" />
<Setter Property="Height" Value="32" />
<Setter Property="Margin" Value="0 2 18 0" />
<Setter Property="Margin" Value="0,2,18,0" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="HorizontalAlignment" Value="Right" />
</Style>
<Style x:Key="ItemHotkeyStyle" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource BaseItemHotkeyStyle}">
<Style
x:Key="ItemHotkeyStyle"
BasedOn="{StaticResource BaseItemHotkeyStyle}"
TargetType="{x:Type TextBlock}">
<Setter Property="FontSize" Value="15" />
<Setter Property="Foreground" Value="#8f8f8f" />
<Setter Property="Opacity" Value="0.5" />
</Style>
<Style x:Key="ItemHotkeySelectedStyle" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource BaseItemHotkeySelecetedStyle}">
<Style
x:Key="ItemHotkeySelectedStyle"
BasedOn="{StaticResource BaseItemHotkeySelecetedStyle}"
TargetType="{x:Type TextBlock}">
<Setter Property="FontSize" Value="15" />
<Setter Property="Foreground" Value="#8f8f8f" />
<Setter Property="Opacity" Value="0.5" />
</Style>
</ResourceDictionary>

View file

@ -37,7 +37,8 @@ namespace Flow.Launcher.Plugin.BrowserBookmark
return new();
foreach (var folder in rootElement.EnumerateObject())
{
EnumerateFolderBookmark(folder.Value, bookmarks, source);
if (folder.Value.ValueKind == JsonValueKind.Object)
EnumerateFolderBookmark(folder.Value, bookmarks, source);
}
return bookmarks;
}
@ -64,4 +65,4 @@ namespace Flow.Launcher.Plugin.BrowserBookmark
}
}
}
}

View file

@ -6,7 +6,6 @@ using System.Text.RegularExpressions;
using System.Windows;
using System.Windows.Controls;
using Mages.Core;
using Flow.Launcher.Infrastructure.Storage;
using Flow.Launcher.Plugin.Caculator.ViewModels;
using Flow.Launcher.Plugin.Caculator.Views;
@ -25,6 +24,9 @@ namespace Flow.Launcher.Plugin.Caculator
@")+$", RegexOptions.Compiled);
private static readonly Regex RegBrackets = new Regex(@"[\(\)\[\]]", RegexOptions.Compiled);
private static Engine MagesEngine;
private const string comma = ",";
private const string dot = ".";
private PluginInitContext Context { get; set; }
private static Settings _settings;
@ -35,7 +37,7 @@ namespace Flow.Launcher.Plugin.Caculator
Context = context;
_settings = context.API.LoadSettingJsonStorage<Settings>();
_viewModel = new SettingsViewModel(_settings);
MagesEngine = new Engine(new Configuration
{
Scope = new Dictionary<string, object>
@ -54,7 +56,19 @@ namespace Flow.Launcher.Plugin.Caculator
try
{
var expression = query.Search.Replace(",", ".");
string expression;
switch (_settings.DecimalSeparator)
{
case DecimalSeparator.Comma:
case DecimalSeparator.UseSystemLocale when CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator == ",":
expression = query.Search.Replace(",", ".");
break;
default:
expression = query.Search;
break;
}
var result = MagesEngine.Interpret(expression);
if (result?.ToString() == "NaN")
@ -76,6 +90,7 @@ namespace Flow.Launcher.Plugin.Caculator
IcoPath = "Images/calculator.png",
Score = 300,
SubTitle = Context.API.GetTranslation("flowlauncher_plugin_calculator_copy_number_to_clipboard"),
CopyText = newResult,
Action = c =>
{
try
@ -119,6 +134,10 @@ namespace Flow.Launcher.Plugin.Caculator
return false;
}
if ((query.Search.Contains(dot) && GetDecimalSeparator() != dot) ||
(query.Search.Contains(comma) && GetDecimalSeparator() != comma))
return false;
return true;
}
@ -142,8 +161,8 @@ namespace Flow.Launcher.Plugin.Caculator
switch (_settings.DecimalSeparator)
{
case DecimalSeparator.UseSystemLocale: return systemDecimalSeperator;
case DecimalSeparator.Dot: return ".";
case DecimalSeparator.Comma: return ",";
case DecimalSeparator.Dot: return dot;
case DecimalSeparator.Comma: return comma;
default: return systemDecimalSeperator;
}
}

View file

@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Flow.Launcher.Plugin.Caculator
{
public class Settings

View file

@ -4,7 +4,7 @@
"Name": "Calculator",
"Description": "Provide mathematical calculations.(Try 5*3-2 in Flow Launcher)",
"Author": "cxfksword",
"Version": "1.1.9",
"Version": "1.1.10",
"Language": "csharp",
"Website": "https://github.com/Flow-Launcher/Flow.Launcher",
"ExecuteFileName": "Flow.Launcher.Plugin.Caculator.dll",

View file

@ -89,6 +89,7 @@
<Expander
x:Name="expExcludedPaths"
Margin="0,10,0,0"
Collapsed="expExcludedPaths_Collapsed"
Expanded="expExcludedPaths_Click"
Header="{DynamicResource plugin_explorer_indexsearchexcludedpaths_header}">
<ListView

View file

@ -60,9 +60,7 @@ namespace Flow.Launcher.Plugin.Explorer.Views
lbxExcludedPaths.Items.SortDescriptions.Add(new SortDescription("Path", ListSortDirection.Ascending));
btnDelete.Visibility = Visibility.Hidden;
btnEdit.Visibility = Visibility.Hidden;
btnAdd.Visibility = Visibility.Hidden;
SetButtonVisibilityToHidden();
if (expAccessLinks.IsExpanded || expExcludedPaths.IsExpanded || expActionKeywords.IsExpanded)
{
@ -123,8 +121,8 @@ namespace Flow.Launcher.Plugin.Explorer.Views
private void expActionKeywords_Collapsed(object sender, RoutedEventArgs e)
{
if (!expActionKeywords.IsExpanded)
expActionKeywords.Height = double.NaN;
expActionKeywords.Height = double.NaN;
SetButtonVisibilityToHidden();
}
private void expAccessLinks_Click(object sender, RoutedEventArgs e)
@ -143,8 +141,8 @@ namespace Flow.Launcher.Plugin.Explorer.Views
private void expAccessLinks_Collapsed(object sender, RoutedEventArgs e)
{
if (!expAccessLinks.IsExpanded)
expAccessLinks.Height = double.NaN;
expAccessLinks.Height = double.NaN;
SetButtonVisibilityToHidden();
}
private void expExcludedPaths_Click(object sender, RoutedEventArgs e)
@ -161,6 +159,11 @@ namespace Flow.Launcher.Plugin.Explorer.Views
RefreshView();
}
private void expExcludedPaths_Collapsed(object sender, RoutedEventArgs e)
{
SetButtonVisibilityToHidden();
}
private void btnDelete_Click(object sender, RoutedEventArgs e)
{
var selectedRow = lbxAccessLinks.SelectedItem as AccessLink ?? lbxExcludedPaths.SelectedItem as AccessLink;
@ -309,6 +312,13 @@ namespace Flow.Launcher.Plugin.Explorer.Views
{
viewModel.OpenWindowsIndexingOptions();
}
public void SetButtonVisibilityToHidden()
{
btnDelete.Visibility = Visibility.Hidden;
btnEdit.Visibility = Visibility.Hidden;
btnAdd.Visibility = Visibility.Hidden;
}
}
public class ActionKeywordView

View file

@ -6,7 +6,7 @@ namespace Flow.Launcher.Plugin.Shell
{
public Shell Shell { get; set; } = Shell.Cmd;
public bool ReplaceWinR { get; set; } = true;
public bool ReplaceWinR { get; set; } = false;
public bool LeaveShellOpen { get; set; }

View file

@ -49,9 +49,10 @@ namespace Flow.Launcher.Plugin.WebSearch
var title = keyword;
string subtitle = _context.API.GetTranslation("flowlauncher_plugin_websearch_search") + " " + searchSource.Title;
//Action Keyword match apear on top
// Action Keyword match apear on top
var score = searchSource.ActionKeyword == SearchSourceGlobalPluginWildCardSign ? scoreStandard : scoreStandard + 1;
// This populates the associated action keyword search entry
if (string.IsNullOrEmpty(keyword))
{
var result = new Result
@ -61,6 +62,7 @@ namespace Flow.Launcher.Plugin.WebSearch
IcoPath = searchSource.IconPath,
Score = score
};
results.Add(result);
}
else
@ -93,7 +95,6 @@ namespace Flow.Launcher.Plugin.WebSearch
if (token.IsCancellationRequested)
return null;
}
return results;

View file

@ -62,4 +62,4 @@ namespace Flow.Launcher.Plugin.WebSearch
return ImageLoader.Load(pathToPreviewIconImage);
}
}
}
}

View file

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
@ -1206,7 +1206,7 @@
<value>Plugin to search for Windows settings</value>
</data>
<data name="PluginTitle" xml:space="preserve">
<value>Windows settings</value>
<value>Windows Settings</value>
</data>
<data name="PowerAndSleep" xml:space="preserve">
<value>Power and sleep</value>

View file

@ -27,7 +27,7 @@ Dedicated to making your workflow flow more seamless. Search everything from app
<img src="https://user-images.githubusercontent.com/6903107/144858082-8b654daf-60fb-4ee6-89b2-6183b73510d1.png" width="100%">
## 🎉 New Features in 1.9
## 🎉 New Features in 1.9
![screenshot](https://user-images.githubusercontent.com/6903107/144855345-45535bc7-7777-4c5a-b8d9-d6ce8adc5e84.png)
@ -51,10 +51,13 @@ Dedicated to making your workflow flow more seamless. Search everything from app
### Installation
| [Windows 7+ installer](https://github.com/Flow-Launcher/Flow.Launcher/releases/latest/download/Flow-Launcher-Setup.exe) | [Portable](https://github.com/Flow-Launcher/Flow.Launcher/releases/latest/download/Flow-Launcher-Portable.zip) | `winget install "Flow Launcher"` | `scoop install Flow-Launcher` |
| :----------------------------------------------------------: | :----------------------------------------------------------: | :------------------------------: | :------------------------------: |
| [Windows 7+ installer](https://github.com/Flow-Launcher/Flow.Launcher/releases/latest/download/Flow-Launcher-Setup.exe) | [Portable](https://github.com/Flow-Launcher/Flow.Launcher/releases/latest/download/Flow-Launcher-Portable.zip) |
| :----------------------------------------------------------: | :----------------------------------------------------------: |
> Windows may complain about security due to code not being signed, this will be completed at a later stage. If you downloaded from this repo, you are good to continue the set up.
| `winget install "Flow Launcher"` | `scoop install Flow-Launcher` | `choco install Flow-Launcher` |
| :------------------------------: | :------------------------------: | :------------------------------: |
> When installing for the first time Windows may raise an issue about security due to code not being signed, if you downloaded from this repo then you are good to continue the set up.
And you can download <a href="https://github.com/Flow-Launcher/Flow.Launcher/discussions" target="_blank">early access version</a>.
@ -67,14 +70,14 @@ And you can download <a href="https://github.com/Flow-Launcher/Flow.Launcher/dis
<img src="https://user-images.githubusercontent.com/6903107/145332614-74909973-f6eb-47c2-8235-289931e30718.png" width="400">
- Search for files or their contents.
- Search for apps, files or file contents.
<img src="https://user-images.githubusercontent.com/6903107/145018796-658b7c24-a34f-46b6-98d4-cf4f636d8b60.png" width="400">
- Support search using environment variable paths.
### Web Search & Open URL
### Web Searches & URLs
<img src="https://user-images.githubusercontent.com/6903107/144517502-5325de01-d0d9-4c2e-aafb-33c3f5d82f81.png" width="400">
<img src="https://user-images.githubusercontent.com/6903107/144831031-0e01e8ea-3247-4ba4-a7b4-48b0db620bc1.png" width="400">
@ -88,14 +91,14 @@ And you can download <a href="https://github.com/Flow-Launcher/Flow.Launcher/dis
<img src="https://user-images.githubusercontent.com/6903107/144517557-9b5b82fc-6408-48a0-af59-69b385a0782e.png" width="400">
- Provides System related commands. shutdown, lock, settings, etc.
- Provides system related commands. shutdown, lock, settings, etc.
- <a href="#system-command-list">System command list</a>
### Calculator
<img src="https://user-images.githubusercontent.com/6903107/144517570-f0e62716-3fdf-4f2a-8986-385a3fcd0663.png" width="400">
- Do mathematical calculations and copy the result to clipboard.
- Do mathematical calculations and copy the result to clipboard.
### Shell Command
@ -110,11 +113,11 @@ And you can download <a href="https://github.com/Flow-Launcher/Flow.Launcher/dis
- Save file or folder locations for quick access.
### Window Setting & Control Panel
### Windows & Control Panel Settings
<img src="https://user-images.githubusercontent.com/6903107/144982305-42a2f63e-0066-4557-9791-0a1c57495ea7.png" width="400">
- Search within Window Settings & Control Panel.
- Search for Windows & Control Panel settings.
### Priority
@ -124,7 +127,7 @@ And you can download <a href="https://github.com/Flow-Launcher/Flow.Launcher/dis
- Prioritise the order of each plugin's results.
### Customization
### Customizations
![Animation5](https://user-images.githubusercontent.com/6903107/144693887-1b92ed16-dca1-4b7e-8644-5e9524cdfb31.gif)
@ -133,27 +136,27 @@ And you can download <a href="https://github.com/Flow-Launcher/Flow.Launcher/dis
![themes](https://user-images.githubusercontent.com/6903107/144527796-7c06ca31-d933-4f6b-9eb0-4fb06fa94384.png)
- There are various themes and you can make it yourself.
- There are various themes and you also can make your own.
### 💬 Language
- Support languages from Chinese to Italian and more.
- Support Pinyin.
- Translation support this project in [Crowdin](https://crowdin.com/project/flow-launcher)
- Supports languages from Chinese to Italian and more.
- Supports Pinyin search.
- [Crowdin](https://crowdin.com/project/flow-launcher) support for language translations.
### Portable
- Fully portable.
- Type `flow user data` to open your saved user settings folder. They are located at:
- If using roaming: `%APPDATA%\FlowLauncher`
- If using portable, by default: `%localappdata%\FlowLauncher\app-<VersionOfYourFlowLauncher>\UserData`
- If using portable, by default: `%localappdata%\FlowLauncher\app-<VersionOfYourFlowLauncher>\UserData`
- Type `open log location` to open your logs folder, they are saved along with your user settings folder.
### 🎮 Game Mode
<img src="https://user-images.githubusercontent.com/6903107/144517711-a7396bbb-f7ae-403d-9644-1414edd9e3f1.png" width="150">
- Suspend the hotkey when you are playing games.
- Pause hotkey activation when you are playing games.
<img src="https://user-images.githubusercontent.com/6903107/144858082-8b654daf-60fb-4ee6-89b2-6183b73510d1.png" width="100%">
@ -164,6 +167,7 @@ And you can download <a href="https://github.com/Flow-Launcher/Flow.Launcher/dis
<p align="center">
<a href="https://flowlauncher.com/docs/#/develop-dotnet-plugins"><img src="https://user-images.githubusercontent.com/6903107/147870065-4096f233-147c-434e-a3ac-69519582605f.png" width="64"></a>
<a href="https://github.com/Flow-Launcher/plugin-samples/tree/master/HelloWorldFSharp"><img src="https://user-images.githubusercontent.com/26427004/156536959-dfdc7be8-4b59-4587-9c6a-a297903e4ce1.png" width="64"></a>
<a href="https://www.flowlauncher.com/docs/#/py-develop-plugins"><img src="https://user-images.githubusercontent.com/6903107/147870066-7599eb15-0333-468e-82e8-4d432ceb5a45.png" width="64"></a>
<a href="https://flowlauncher.com/docs/#/nodejs-develop-plugins"><img src="https://user-images.githubusercontent.com/6903107/147870071-d67c736b-0748-428f-a283-14587696dfa3.png" width="64"></a>
<a href="https://flowlauncher.com/docs/#/nodejs-develop-plugins"><img src="https://user-images.githubusercontent.com/6903107/147870069-9bde6fe6-d50c-4d85-8fde-fe5ae921ab8c.png" width="64"></a>
@ -192,7 +196,7 @@ And you can download <a href="https://github.com/Flow-Launcher/Flow.Launcher/dis
### Github
<img src="https://user-images.githubusercontent.com/6903107/144533497-8677f800-95c5-4758-8ca3-c96333ee1943.png" width="400">
### Window Walker
<img src="https://user-images.githubusercontent.com/6903107/144533517-07bf011f-726c-4221-8657-0e442eca8a82.png" width="400">
@ -204,7 +208,7 @@ And you can download <a href="https://github.com/Flow-Launcher/Flow.Launcher/dis
![pluginstore](https://user-images.githubusercontent.com/6903107/144528115-3b6baa89-f53f-40db-8426-02c4db8dd2b5.png)
- You can view the full plugin list or quickly install a plugin via the Plugin Store menu in Settings
- You can view the full plugin list or quickly install a plugin via the Plugin Store menu inside Settings
- or type `pm` `install`/`uninstall`/`update` + the plugin name in the search window,
@ -215,18 +219,19 @@ And you can download <a href="https://github.com/Flow-Launcher/Flow.Launcher/dis
| Hotkey | Description |
| ------------------------------------------------------------ | -------------------------------------------- |
| <kbd>Alt</kbd>+ <kbd>Space</kbd> | Open Search Box (default and configurable) |
| <kbd>Alt</kbd>+ <kbd>Space</kbd> | Open search window (default and configurable)|
| <kbd>Enter</kbd> | Execute |
| <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>Enter</kbd> | Run As Admin |
| <kbd></kbd><kbd></kbd> | Scroll up & Down |
| <kbd></kbd><kbd></kbd> | Back to Result / Open Context Menu |
| <kbd>Ctrl</kbd> +<kbd>o</kbd> , <kbd>Shift</kbd> +<kbd>Enter</kbd> | Open Context Menu |
| <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>Enter</kbd> | Run commands from Shell plugin as admin |
| <kbd></kbd><kbd></kbd> | Scroll up & down |
| <kbd></kbd><kbd></kbd> | Back to result / Open Context Menu |
| <kbd>Ctrl</kbd> +<kbd>O</kbd> , <kbd>Shift</kbd> +<kbd>Enter</kbd> | Open Context Menu |
| <kbd>Tab</kbd> | Autocomplete |
| <kbd>Esc</kbd> | Back to Result & Close |
| <kbd>Ctrl</kbd> +<kbd>i</kbd> | Open Setting Window |
| <kbd>F5</kbd> | Reload All Plugin Data & Window Search Index |
| <kbd>Ctrl</kbd> + <kbd>h</kbd> | Open Query History |
| <kbd>Ctrl</kbd> + <kbd>Backspace</kbd> | Back to Previous Directory |
| <kbd>Esc</kbd> | Back to results / hide search window |
| <kbd>Ctrl</kbd> +<kbd>C</kbd> | Copy the actual folder / file |
| <kbd>Ctrl</kbd> +<kbd>I</kbd> | Open Settings window |
| <kbd>F5</kbd> | Reload all plugin data |
| <kbd>Ctrl</kbd> + <kbd>H</kbd> | Open search history |
| <kbd>Ctrl</kbd> + <kbd>Backspace</kbd> | Back to previous directory |
## System Command List
@ -263,13 +268,9 @@ Yes please, let us know in the [Q&A](https://github.com/Flow-Launcher/Flow.Launc
## Development
### Status
Flow is under heavy development, but the code base is stable, so contributions are very welcome. If you would like to help maintain it, please do not hesistate to get in touch.
### Contributing
We welcome all contributions. If you are unsure of a change you want to make, let us know in the [Discussions](https://github.com/Flow-Launcher/Flow.Launcher/discussions/categories/ideas), otherwise feel free to put in a pull request.
Contributions are very welcome, in addition to the main project(C#) there are also [documentation](https://github.com/Flow-Launcher/docs)(md), [website](https://github.com/Flow-Launcher/flow-launcher.github.io)(html/css) and [others](https://github.com/Flow-Launcher) that can be contributed to. If you are unsure of a change you want to make, let us know in the [Discussions](https://github.com/Flow-Launcher/Flow.Launcher/discussions/categories/ideas), otherwise feel free to put in a pull request.
You will find the main goals of flow placed under the [Projects board](https://github.com/Flow-Launcher/Flow.Launcher/projects), so feel free to contribute on that. If you would like to make small incremental changes, feel free to do so as well.

View file

@ -1,4 +1,4 @@
version: '1.9.2.{build}'
version: '1.9.3.{build}'
init:
- ps: |
@ -69,15 +69,3 @@ deploy:
force_update: true
on:
APPVEYOR_REPO_TAG: true
environment:
winget_token:
secure: HKfVT2FYZITAG0qqMCePYhIem5a/gzvAgYDSlr6RlXfGmeBUOANUtgJ9X6fNroxN
on_success:
- ps: |
if ($env:APPVEYOR_REPO_BRANCH -eq "master" -and $env:APPVEYOR_REPO_TAG -eq "true")
{
iwr https://github.com/microsoft/winget-create/releases/download/v0.2.0.29-preview/wingetcreate.exe -OutFile wingetcreate.exe
.\wingetcreate.exe update Flow-Launcher.Flow-Launcher -s true -u https://github.com/Flow-Launcher/Flow.Launcher/releases/download/v$env:flowVersion/Flow-Launcher-Setup.exe -v $env:flowVersion -t $env:winget_token
}