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

Context menu on the TextEdit widget #4393

Open
mexus opened this issue Apr 22, 2024 · 0 comments
Open

Context menu on the TextEdit widget #4393

mexus opened this issue Apr 22, 2024 · 0 comments

Comments

@mexus
Copy link

mexus commented Apr 22, 2024

Is your feature request related to a problem? Please describe.
It is a bit inconvenient that we do not have the ability to use a context menu for standard operations such as cut/copy/paste/select all/etc.

Describe the solution you'd like
Some way to add a context menu to the TextEdit widget without loosing the text selection information.

Describe alternatives you've considered
At first, I tried to go with a straightforward solution of calling a "context_menu" on the "Response" returned by the "TextEdit::ui", but it didn't work at all. No context menu on the right click appeared.

Then, I added the "context_menu" to the outer widget ("CentralPanel") and noticed that the context menu appears almost everywhere, but not on the TextEdit.

I ended up inspecting the "output.response.clicked_by(egui::PointerButton::Secondary)" property to find out that the "output.cursor_range" doesn't contain the actual selection. So, unfortunately, I can't use this workaround.

Additional context

Actually all I need is just a "copy" button that appears near the selected text which copies the selected text, so there might probably an easier solution than implementing a full-fledged context menu for the widget.

Thanks!!

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

No branches or pull requests

1 participant