From 4ad967b5f31c5e500d8ff08b5a897806c9890daa Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Mon, 23 Dec 2024 15:57:59 +0800 Subject: [PATCH] Add support for removing selected count from score --- Flow.Launcher.Plugin/Result.cs | 5 +++++ Flow.Launcher/ViewModel/MainViewModel.cs | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Flow.Launcher.Plugin/Result.cs b/Flow.Launcher.Plugin/Result.cs index 027631533..57ee1e921 100644 --- a/Flow.Launcher.Plugin/Result.cs +++ b/Flow.Launcher.Plugin/Result.cs @@ -263,6 +263,11 @@ namespace Flow.Launcher.Plugin /// public PreviewInfo Preview { get; set; } = PreviewInfo.Default; + /// + /// Determines if the selected count should be added to the score + /// + public bool AddSelectedCount { get; set; } = true; + /// /// Info of the preview section of a /// diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index 8bfd2f4e5..6458316bb 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -1476,7 +1476,9 @@ namespace Flow.Launcher.ViewModel else if (result.Score != int.MaxValue) { var priorityScore = metaResults.Metadata.Priority * 150; - result.Score += _userSelectedRecord.GetSelectedCount(result) + priorityScore; + result.Score += result.AddSelectedCount ? + _userSelectedRecord.GetSelectedCount(result) + priorityScore : + priorityScore; } } }