From 4b09e07e09d3a07b0ef0d369a989e6b9f082e045 Mon Sep 17 00:00:00 2001 From: Hongtao Zhang Date: Thu, 31 Mar 2022 13:53:07 -0500 Subject: [PATCH 1/8] Use decimal separator in setting for query --- Plugins/Flow.Launcher.Plugin.Calculator/Main.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs b/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs index 7de4d30fe..d72dd057e 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs @@ -35,7 +35,7 @@ namespace Flow.Launcher.Plugin.Caculator Context = context; _settings = context.API.LoadSettingJsonStorage(); _viewModel = new SettingsViewModel(_settings); - + MagesEngine = new Engine(new Configuration { Scope = new Dictionary @@ -54,7 +54,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 +88,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 From 4183f9375b3ca9073b5fe7a80eff650ab86b1d66 Mon Sep 17 00:00:00 2001 From: DB p Date: Sun, 10 Apr 2022 02:53:32 +0900 Subject: [PATCH 2/8] Remove All Cleartype Rendering --- Flow.Launcher/Themes/Base.xaml | 197 ++++++++++++++++++--------------- 1 file changed, 108 insertions(+), 89 deletions(-) diff --git a/Flow.Launcher/Themes/Base.xaml b/Flow.Launcher/Themes/Base.xaml index 454904f3a..087606d04 100644 --- a/Flow.Launcher/Themes/Base.xaml +++ b/Flow.Launcher/Themes/Base.xaml @@ -1,15 +1,16 @@ - + - + - - - + - - + + - - - - + @@ -152,7 +158,7 @@ - + @@ -160,44 +166,50 @@ - - + + - - + + - + - + @@ -249,12 +263,12 @@ - - + + - - - \ No newline at end of file From 15fd62a8b0cedbc181ab60493e8f7d9cf1d2a2d8 Mon Sep 17 00:00:00 2001 From: Garulf <535299+Garulf@users.noreply.github.com> Date: Wed, 20 Apr 2022 03:47:27 -0400 Subject: [PATCH 3/8] Add Stale issue workflow (#1104) --- .github/ISSUE_TEMPLATE/workflows/stale.yml | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/workflows/stale.yml diff --git a/.github/ISSUE_TEMPLATE/workflows/stale.yml b/.github/ISSUE_TEMPLATE/workflows/stale.yml new file mode 100644 index 000000000..6abd850ed --- /dev/null +++ b/.github/ISSUE_TEMPLATE/workflows/stale.yml @@ -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.' \ No newline at end of file From b177f6d67fc4badf169114beaa4ffb11e77b5369 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Sun, 24 Apr 2022 19:33:06 +1000 Subject: [PATCH 4/8] add decimal separator check to CanCalculate --- Plugins/Flow.Launcher.Plugin.Calculator/Main.cs | 14 ++++++++++---- .../Flow.Launcher.Plugin.Calculator/Settings.cs | 7 +------ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs b/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs index d72dd057e..ea278b49b 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs @@ -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; @@ -60,7 +62,7 @@ namespace Flow.Launcher.Plugin.Caculator { case DecimalSeparator.Comma: case DecimalSeparator.UseSystemLocale when CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator == ",": - expression = query.Search.Replace(".", ","); + expression = query.Search.Replace(",", "."); break; default: expression = query.Search; @@ -132,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; } @@ -155,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; } } diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Settings.cs b/Plugins/Flow.Launcher.Plugin.Calculator/Settings.cs index 10cee364b..615514873 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Settings.cs +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Settings.cs @@ -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 From 66f835fb001e2a02510fdd48603ab67ea34a90dc Mon Sep 17 00:00:00 2001 From: Jeremy Date: Sun, 24 Apr 2022 19:34:43 +1000 Subject: [PATCH 5/8] calculator plugin version bump --- Plugins/Flow.Launcher.Plugin.Calculator/plugin.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/plugin.json b/Plugins/Flow.Launcher.Plugin.Calculator/plugin.json index 0b0921868..771babb90 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/plugin.json +++ b/Plugins/Flow.Launcher.Plugin.Calculator/plugin.json @@ -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", From 90027d42d280f048b5285a7ab53ffdbf0148dba7 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Sat, 7 May 2022 20:01:54 +1000 Subject: [PATCH 6/8] update Python download mirrors --- Flow.Launcher.Core/Flow.Launcher.Core.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Flow.Launcher.Core/Flow.Launcher.Core.csproj b/Flow.Launcher.Core/Flow.Launcher.Core.csproj index 60c4ec3de..be7b88a27 100644 --- a/Flow.Launcher.Core/Flow.Launcher.Core.csproj +++ b/Flow.Launcher.Core/Flow.Launcher.Core.csproj @@ -53,7 +53,7 @@ - + From a6a451c7f0e48468dcd5cceb32e6693333e9b2ea Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Sun, 8 May 2022 11:42:28 +1000 Subject: [PATCH 7/8] Add choco install cmd to readme (#1166) --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 81946bf8a..b6d025d46 100644 --- a/README.md +++ b/README.md @@ -51,8 +51,11 @@ 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) | +| :----------------------------------------------------------: | :----------------------------------------------------------: | + +| `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. From dd548732d1645c0c391e9b05191f26bd535d785a Mon Sep 17 00:00:00 2001 From: Garulf <535299+Garulf@users.noreply.github.com> Date: Tue, 10 May 2022 19:47:04 -0400 Subject: [PATCH 8/8] Move workflow to proper directory --- .github/{ISSUE_TEMPLATE => }/workflows/stale.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{ISSUE_TEMPLATE => }/workflows/stale.yml (100%) diff --git a/.github/ISSUE_TEMPLATE/workflows/stale.yml b/.github/workflows/stale.yml similarity index 100% rename from .github/ISSUE_TEMPLATE/workflows/stale.yml rename to .github/workflows/stale.yml