Add CopyText field for plugin support

This commit is contained in:
Garulf 2021-12-04 00:48:18 -05:00
parent bf317b8caa
commit 20d80283a4
2 changed files with 10 additions and 6 deletions

View file

@ -29,6 +29,8 @@ namespace Flow.Launcher.Plugin
/// </summary>
public string ActionKeywordAssigned { get; set; }
public string CopyText { get; set; } = String.Empty;
public string IcoPath
{
get { return _icoPath; }

View file

@ -56,15 +56,17 @@ namespace Flow.Launcher
var result = results.SelectedItem?.Result;
if (result != null) // SelectedItem returns null if selection is empty.
{
System.Windows.Clipboard.SetDataObject(result.Title.ToString());
string _copyText = String.IsNullOrEmpty(result.CopyText) ? result.Title : result.CopyText;
System.Windows.Clipboard.SetDataObject(_copyText.ToString());
e.Handled = true;
}
}
else if (!String.IsNullOrEmpty(QueryTextBox.Text))
{
System.Windows.Clipboard.SetDataObject(QueryTextBox.SelectedText);
}
e.Handled = true;
//else if (!String.IsNullOrEmpty(QueryTextBox.Text))
//{
// System.Windows.Clipboard.SetDataObject(QueryTextBox.SelectedText);
//}
e.Handled = false;
}
private async void OnClosing(object sender, CancelEventArgs e)
{