mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
parent
206532f195
commit
3604e6fa7d
3 changed files with 22 additions and 6 deletions
|
|
@ -235,7 +235,11 @@ namespace Wox
|
|||
|
||||
private void OnTextChanged(object sender, TextChangedEventArgs e)
|
||||
{
|
||||
QueryTextBox.CaretIndex = QueryTextBox.Text.Length;
|
||||
if (_viewModel.QueryTextCursorMovedToEnd)
|
||||
{
|
||||
QueryTextBox.CaretIndex = QueryTextBox.Text.Length;
|
||||
_viewModel.QueryTextCursorMovedToEnd = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -36,12 +36,12 @@ namespace Wox
|
|||
|
||||
public void ChangeQuery(string query, bool requery = false)
|
||||
{
|
||||
_mainVM.QueryText = query;
|
||||
_mainVM.ChangeQueryText(query);
|
||||
}
|
||||
|
||||
public void ChangeQueryText(string query, bool selectAll = false)
|
||||
{
|
||||
_mainVM.QueryText = query;
|
||||
_mainVM.ChangeQueryText(query);
|
||||
}
|
||||
|
||||
[Obsolete]
|
||||
|
|
|
|||
|
|
@ -205,7 +205,19 @@ namespace Wox.ViewModel
|
|||
Query();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// we need move cursor to end when we manually changed query
|
||||
/// but we don't want to move cursor to end when query is updated from TextBox
|
||||
/// </summary>
|
||||
/// <param name="queryText"></param>
|
||||
public void ChangeQueryText(string queryText)
|
||||
{
|
||||
QueryTextCursorMovedToEnd = true;
|
||||
QueryText = queryText;
|
||||
}
|
||||
public bool QueryTextSelected { get; set; }
|
||||
public bool QueryTextCursorMovedToEnd { get; set; }
|
||||
|
||||
private ResultsViewModel _selectedResults;
|
||||
private ResultsViewModel SelectedResults
|
||||
|
|
@ -218,7 +230,7 @@ namespace Wox.ViewModel
|
|||
{
|
||||
ContextMenu.Visbility = Visibility.Collapsed;
|
||||
History.Visbility = Visibility.Collapsed;
|
||||
QueryText = _queryTextBeforeLeaveResults;
|
||||
ChangeQueryText(_queryTextBeforeLeaveResults);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -325,7 +337,7 @@ namespace Wox.ViewModel
|
|||
Action = _ =>
|
||||
{
|
||||
SelectedResults = Results;
|
||||
QueryText = h.Query;
|
||||
ChangeQueryText(h.Query);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
|
@ -547,7 +559,7 @@ namespace Wox.ViewModel
|
|||
{
|
||||
if (ShouldIgnoreHotkeys()) return;
|
||||
MainWindowVisibility = Visibility.Visible;
|
||||
QueryText = hotkey.ActionKeyword;
|
||||
ChangeQueryText(hotkey.ActionKeyword);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue