Add maximum score to the results for developers.

This commit is contained in:
Jack251970 2024-12-24 11:54:15 +08:00
parent 1c01fa4e46
commit 269e583ea7
2 changed files with 7 additions and 2 deletions

View file

@ -268,6 +268,11 @@ namespace Flow.Launcher.Plugin
/// </summary>
public bool AddSelectedCount { get; set; } = true;
/// <summary>
/// Maximum score. This can be useful when set one result to the top by default. This is the score for the results set to the topmost by users.
/// </summary>
public const int MaxScore = int.MaxValue;
/// <summary>
/// Info of the preview section of a <see cref="Result"/>
/// </summary>

View file

@ -1471,9 +1471,9 @@ namespace Flow.Launcher.ViewModel
{
if (_topMostRecord.IsTopMost(result))
{
result.Score = int.MaxValue;
result.Score = Result.MaxScore;
}
else if (result.Score != int.MaxValue)
else if (result.Score != Result.MaxScore)
{
var priorityScore = metaResults.Metadata.Priority * 150;
result.Score += result.AddSelectedCount ?