mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Only copy result title if query text is unselected
This commit is contained in:
parent
6f556a47b5
commit
621d48725a
1 changed files with 10 additions and 5 deletions
|
|
@ -49,13 +49,18 @@ namespace Flow.Launcher
|
|||
}
|
||||
private void OnCopy(object sender, ExecutedRoutedEventArgs e)
|
||||
{
|
||||
var results = _viewModel.Results;
|
||||
var result = results.SelectedItem?.Result;
|
||||
if (result != null) // SelectedItem returns null if selection is empty.
|
||||
var _NewClipboard = QueryTextBox.SelectedText;
|
||||
if (QueryTextBox.SelectionLength == 0)
|
||||
{
|
||||
|
||||
System.Windows.Clipboard.SetDataObject(result.Title.ToString());
|
||||
var results = _viewModel.Results;
|
||||
var result = results.SelectedItem?.Result;
|
||||
if (result != null) // SelectedItem returns null if selection is empty.
|
||||
{
|
||||
_NewClipboard = result.Title.ToString();
|
||||
}
|
||||
|
||||
}
|
||||
System.Windows.Clipboard.SetDataObject(_NewClipboard);
|
||||
e.Handled = true;
|
||||
}
|
||||
private async void OnClosing(object sender, CancelEventArgs e)
|
||||
|
|
|
|||
Loading…
Reference in a new issue