Label Text selectable #353
Replies: 3 comments 6 replies
-
No. I believe a "Click to copy" button is way better UX anyway: if ui.button("📋").on_hover_text("Click to copy").clicked() {
ui.output().copied_text = what_the_user_is_interested_in;
} |
Beta Was this translation helpful? Give feedback.
-
In case it helps anyone, clickable label: if ui
.add(
egui::Label::new("Label Text")
.sense(egui::Sense::click()),
)
.on_hover_text("Click to copy 'Label Text'")
.clicked()
{
ui.output_mut(|po| {
po.copied_text = String::from("Label Text");
});
} I'm on egui 0.21.0. |
Beta Was this translation helpful? Give feedback.
-
For the record, this is now possible with the current egui master. I'm not sure of when it was introduced. Simply pass a ui.label("Label for comparison");
ui.add(
TextEdit::multiline(&mut "Immutable &str\nSecond line")
.min_size([0.0, 0.0].into())
.desired_rows(1),
);
let mut mut_string = String::from("Mutable string");
ui.text_edit_multiline(&mut mut_string.as_str());
ui.text_edit_multiline(&mut mut_string); |
Beta Was this translation helpful? Give feedback.
-
Is there a way to make label text selectable because currently it is not?
Beta Was this translation helpful? Give feedback.
All reactions