Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

copied_text function maintained in copy_text() until deletion #5553

Closed
wants to merge 3 commits into from

Conversation

rustbasic
Copy link
Contributor

My opinion is that it would be better to keep the current copied_text without deprecating it, rather than creating a new function to identify or modify the content on the clipboard.

at least until copied_text is removed, the copy_text() function should continue to use copied_text in the same way it currently does.

Copy link

Preview available at https://egui-pr-preview.github.io/pr/5553-patch157
Note that it might take a couple seconds for the update to show up after the preview_build workflow has completed.

CHANGELOG.md Outdated
@@ -1230,7 +1230,7 @@ egui_extras::install_image_loaders(egui_ctx);
* [Tweaked the default visuals style](https://github.com/emilk/egui/pull/450).
* Plot: Renamed `Curve` to `Line`.
* `TopPanel::top` is now `TopBottomPanel::top`.
* `SidePanel::left` no longet takes the default width by argument, but by a builder call.
* `SidePanel::left` no longest takes the default width by argument, but by a builder call.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be longer.

@rustbasic rustbasic requested a review from YgorSouza January 1, 2025 00:52
@emilk
Copy link
Owner

emilk commented Jan 2, 2025

why?

@rustbasic
Copy link
Contributor Author

why?

copied_text is needed in the following cases:

  1. When checking characters copied to the clipboard.
  2. When changing characters such as ' ', '\t', '\r', '\n'.
  3. When filtering characters copied to the clipboard (deleting, prohibiting, changing).
  4. When encrypting and restoring the clipboard for security purposes."

@emilk
Copy link
Owner

emilk commented Jan 6, 2025

But why not iterate over PlatformOutput::commands and do the same logic there?

@rustbasic
Copy link
Contributor Author

But why not iterate over PlatformOutput::commands and do the same logic there?

In typical scenarios, we use PlatformOutput::commands. However, there are cases where we need to immediately know or modify the content copied from TextEdit. Also, the current PlatformOutput::commands functionality doesn't seem to have a feature to retrieve the content. Even if a feature to retrieve the content existed, it wouldn't address situations where immediate modification is required.

@emilk emilk closed this Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants