mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Merge branch 'dev' into 240518Adjusthemes
This commit is contained in:
commit
7df98262c1
1 changed files with 16 additions and 1 deletions
|
|
@ -670,12 +670,27 @@ namespace Flow.Launcher.ViewModel
|
||||||
get { return _selectedResults; }
|
get { return _selectedResults; }
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
|
var isReturningFromContextMenu = ContextMenuSelected();
|
||||||
_selectedResults = value;
|
_selectedResults = value;
|
||||||
if (SelectedIsFromQueryResults())
|
if (SelectedIsFromQueryResults())
|
||||||
{
|
{
|
||||||
ContextMenu.Visibility = Visibility.Collapsed;
|
ContextMenu.Visibility = Visibility.Collapsed;
|
||||||
History.Visibility = Visibility.Collapsed;
|
History.Visibility = Visibility.Collapsed;
|
||||||
ChangeQueryText(_queryTextBeforeLeaveResults);
|
|
||||||
|
// QueryText setter (used in ChangeQueryText) runs the query again, resetting the selected
|
||||||
|
// result from the one that was selected before going into the context menu to the first result.
|
||||||
|
// The code below correctly restores QueryText and puts the text caret at the end without
|
||||||
|
// running the query again when returning from the context menu.
|
||||||
|
if (isReturningFromContextMenu)
|
||||||
|
{
|
||||||
|
_queryText = _queryTextBeforeLeaveResults;
|
||||||
|
OnPropertyChanged(nameof(QueryText));
|
||||||
|
QueryTextCursorMovedToEnd = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ChangeQueryText(_queryTextBeforeLeaveResults);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue