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

How to copy the text? #2033

Closed
goldwind-ting opened this issue Sep 9, 2022 · 5 comments
Closed

How to copy the text? #2033

goldwind-ting opened this issue Sep 9, 2022 · 5 comments

Comments

@goldwind-ting
Copy link

ScrollArea::vertical().auto_shrink([false; 2]).show_rows(
                ui,
                row_height,
                num_rows,
                |ui, row_range| {
                    for row in row_range {
                        if row == 0 {
                            ui.columns(3, |columns| {
                                columns[0].label("Desc");
                                columns[1].label("Account");
                                columns[2].label("Password");
                            });
                        } else {
                            if row - 1 >= self.data.len() {
                                break;
                            }
                            let col = &self.data[row - 1];
                            ui.columns(3, |columns| {
                                columns[0].label(&col[0]);
                                columns[1].label(&col[1]);
                                columns[2].label(&col[2]);
                            });
                        }
                    }
                },
            );

how to copy the text in the columns?
image

@ar37-rs
Copy link
Contributor

ar37-rs commented Sep 9, 2022

Maybe it's good idea to just take a look at font book on demo example, if you click the emoji symbol it will be automatically copied to the clipboard.

@goldwind-ting
Copy link
Author

goldwind-ting commented Sep 9, 2022

it is a little bit different, I want to drag the cursor to select text in the column.

@0xFar5eer
Copy link

I have the same question how to copy text from text_edit ?
I even tried like this, but does not work:
if ui.text_edit_singleline(link_to_profile).clicked() { ui.output().copied_text = link_to_profile.to_string(); }

Any ideas how to copy text CTRL + C on text edit?

@Junoburger
Copy link

Would like this feature as well.

Unless something changed since the last answer in this thread
Selecting (label) text with a mouse and copying it has not been implemented yet.

@YgorSouza
Copy link
Contributor

This has been implemented in #3814 and #3870, so I think this issue can be closed.

@emilk emilk closed this as completed Feb 5, 2024
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

6 participants