mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Reduce batch time to speed up view update
change selected index update place to fix not first selection issue
This commit is contained in:
parent
f51d2c57c7
commit
4b2abfc708
2 changed files with 7 additions and 2 deletions
|
|
@ -111,7 +111,7 @@ namespace Flow.Launcher.ViewModel
|
|||
while (true)
|
||||
{
|
||||
List<ResultsForUpdate> queue = new List<ResultsForUpdate>() { _resultsUpdateQueue.Take() };
|
||||
await Task.Delay(50);
|
||||
await Task.Delay(30);
|
||||
|
||||
while (_resultsUpdateQueue.TryTake(out var resultsForUpdate))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -158,6 +158,11 @@ namespace Flow.Launcher.ViewModel
|
|||
public void AddResults(IEnumerable<ResultsForUpdate> resultsForUpdates)
|
||||
{
|
||||
var newResults = NewResults(resultsForUpdates);
|
||||
|
||||
// https://social.msdn.microsoft.com/Forums/vstudio/en-US/5ff71969-f183-4744-909d-50f7cd414954/binding-a-tabcontrols-selectedindex-not-working?forum=wpf
|
||||
// fix selected index flow
|
||||
SelectedIndex = 0;
|
||||
|
||||
lock (_collectionLock)
|
||||
{
|
||||
Results.Update(newResults);
|
||||
|
|
@ -167,7 +172,6 @@ namespace Flow.Launcher.ViewModel
|
|||
{
|
||||
case Visibility.Collapsed when Results.Count > 0:
|
||||
Margin = new Thickness { Top = 8 };
|
||||
SelectedIndex = 0;
|
||||
Visbility = Visibility.Visible;
|
||||
break;
|
||||
case Visibility.Visible when Results.Count == 0:
|
||||
|
|
@ -175,6 +179,7 @@ namespace Flow.Launcher.ViewModel
|
|||
Visbility = Visibility.Collapsed;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue