Handle clipboard paste event if text

This commit is contained in:
Garulf 2023-12-26 09:46:46 -05:00
parent 2107402ba8
commit db6e54160f

View file

@ -71,6 +71,15 @@ namespace Flow.Launcher
App.API.CopyToClipboard(QueryTextBox.SelectedText, showDefaultNotification: false);
}
}
private void OnPaste(object sender, ExecutedRoutedEventArgs e)
{
if (System.Windows.Clipboard.ContainsText())
{
_viewModel.QueryText = System.Windows.Clipboard.GetText().Replace("\n", String.Empty).Replace("\r", String.Empty);
e.Handled = true;
}
}
private async void OnClosing(object sender, CancelEventArgs e)
{