Skip to content

Commit 874b8bd

Browse files
committed
Ensure minimum reserved result count is 1 for grid
Prevent value from being set to 0 when reserving results for the pinned grid layout by using Math.Max(1, ...). This guarantees at least one result is always reserved, even with low MaxResultsToShow settings.
1 parent b58ba32 commit 874b8bd

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Flow.Launcher/ViewModel/MainViewModel.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,15 +1091,16 @@ public double PinnedGridReservedResultCount
10911091
Settings.EnablePinnedResults &&
10921092
Settings.PinnedResultsLayout == PinnedLayoutOptions.Grid)
10931093
{
1094-
value = Settings.MaxResultsToShow * 0.25;
1094+
value = Math.Max(1, Settings.MaxResultsToShow * 0.25);
10951095
}
10961096

10971097
if (value != _pinnedGridReservedResultCount)
10981098
{
10991099
_pinnedGridReservedResultCount = value;
11001100
OnPropertyChanged(nameof(PinnedGridHeightForEmptyQuery));
11011101
}
1102-
return value;
1102+
1103+
return _pinnedGridReservedResultCount;
11031104
}
11041105
}
11051106

0 commit comments

Comments
 (0)