mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Add CopyText field for plugin support
This commit is contained in:
parent
bf317b8caa
commit
20d80283a4
2 changed files with 10 additions and 6 deletions
|
|
@ -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; }
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue