mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
Optimize speed for CMD mode
This commit is contained in:
@@ -168,6 +168,7 @@ namespace Wox
|
|||||||
notifyIcon.ContextMenu = new ContextMenu(childen);
|
notifyIcon.ContextMenu = new ContextMenu(childen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool isCMDMode = false;
|
||||||
private void TextBoxBase_OnTextChanged(object sender, TextChangedEventArgs e)
|
private void TextBoxBase_OnTextChanged(object sender, TextChangedEventArgs e)
|
||||||
{
|
{
|
||||||
toolTip.IsOpen = false;
|
toolTip.IsOpen = false;
|
||||||
@@ -182,7 +183,7 @@ namespace Wox
|
|||||||
// must clear the result. otherwise, it will be confused why the query changed, but the results
|
// must clear the result. otherwise, it will be confused why the query changed, but the results
|
||||||
// didn't.
|
// didn't.
|
||||||
if (resultCtrl.Dirty) resultCtrl.Clear();
|
if (resultCtrl.Dirty) resultCtrl.Clear();
|
||||||
}, TimeSpan.FromMilliseconds(30), null);
|
}, TimeSpan.FromMilliseconds(100), null);
|
||||||
var q = new Query(tbQuery.Text);
|
var q = new Query(tbQuery.Text);
|
||||||
CommandFactory.DispatchCommand(q);
|
CommandFactory.DispatchCommand(q);
|
||||||
queryHasReturn = false;
|
queryHasReturn = false;
|
||||||
@@ -194,9 +195,9 @@ namespace Wox
|
|||||||
{
|
{
|
||||||
StartProgress();
|
StartProgress();
|
||||||
}
|
}
|
||||||
}, TimeSpan.FromSeconds(1), tbQuery.Text);
|
}, TimeSpan.FromSeconds(0), tbQuery.Text);
|
||||||
}
|
}
|
||||||
}, TimeSpan.FromMilliseconds(150));
|
}, TimeSpan.FromMilliseconds((isCMDMode = tbQuery.Text.StartsWith(">")) ? 0 : 150));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Border_OnMouseDown(object sender, MouseButtonEventArgs e)
|
private void Border_OnMouseDown(object sender, MouseButtonEventArgs e)
|
||||||
@@ -382,7 +383,7 @@ namespace Wox
|
|||||||
List<Result> l = waitShowResultList.Where(o => o.OriginQuery != null && o.OriginQuery.RawQuery == tbQuery.Text).ToList();
|
List<Result> l = waitShowResultList.Where(o => o.OriginQuery != null && o.OriginQuery.RawQuery == tbQuery.Text).ToList();
|
||||||
waitShowResultList.Clear();
|
waitShowResultList.Clear();
|
||||||
resultCtrl.AddResults(l);
|
resultCtrl.AddResults(l);
|
||||||
})), TimeSpan.FromMilliseconds(50));
|
})), TimeSpan.FromMilliseconds(isCMDMode ? 0 : 50));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user