Skip to content

Commit 20d8028

Browse files
committed
Add CopyText field for plugin support
1 parent bf317b8 commit 20d8028

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

Flow.Launcher.Plugin/Result.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ public class Result
2929
/// </summary>
3030
public string ActionKeywordAssigned { get; set; }
3131

32+
public string CopyText { get; set; } = String.Empty;
33+
3234
public string IcoPath
3335
{
3436
get { return _icoPath; }

Flow.Launcher/MainWindow.xaml.cs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,17 @@ private void OnCopy(object sender, ExecutedRoutedEventArgs e)
5656
var result = results.SelectedItem?.Result;
5757
if (result != null) // SelectedItem returns null if selection is empty.
5858
{
59-
System.Windows.Clipboard.SetDataObject(result.Title.ToString());
59+
string _copyText = String.IsNullOrEmpty(result.CopyText) ? result.Title : result.CopyText;
60+
System.Windows.Clipboard.SetDataObject(_copyText.ToString());
61+
e.Handled = true;
6062
}
6163

6264
}
63-
else if (!String.IsNullOrEmpty(QueryTextBox.Text))
64-
{
65-
System.Windows.Clipboard.SetDataObject(QueryTextBox.SelectedText);
66-
}
67-
e.Handled = true;
65+
//else if (!String.IsNullOrEmpty(QueryTextBox.Text))
66+
//{
67+
// System.Windows.Clipboard.SetDataObject(QueryTextBox.SelectedText);
68+
//}
69+
e.Handled = false;
6870
}
6971
private async void OnClosing(object sender, CancelEventArgs e)
7072
{

0 commit comments

Comments
 (0)