Skip to content

Commit 269e583

Browse files
committed
Add maximum score to the results for developers.
1 parent 1c01fa4 commit 269e583

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Flow.Launcher.Plugin/Result.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,11 @@ public ValueTask<bool> ExecuteAsync(ActionContext context)
268268
/// </summary>
269269
public bool AddSelectedCount { get; set; } = true;
270270

271+
/// <summary>
272+
/// 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.
273+
/// </summary>
274+
public const int MaxScore = int.MaxValue;
275+
271276
/// <summary>
272277
/// Info of the preview section of a <see cref="Result"/>
273278
/// </summary>

Flow.Launcher/ViewModel/MainViewModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,9 +1471,9 @@ public void UpdateResultView(ICollection<ResultsForUpdate> resultsForUpdates)
14711471
{
14721472
if (_topMostRecord.IsTopMost(result))
14731473
{
1474-
result.Score = int.MaxValue;
1474+
result.Score = Result.MaxScore;
14751475
}
1476-
else if (result.Score != int.MaxValue)
1476+
else if (result.Score != Result.MaxScore)
14771477
{
14781478
var priorityScore = metaResults.Metadata.Priority * 150;
14791479
result.Score += result.AddSelectedCount ?

0 commit comments

Comments
 (0)