mirror of
https://github.com/emilk/egui.git
synced 2026-07-19 04:58:54 +00:00
5ed92c3011
feat: Add left_text() to egui::Button
This PR introduces the `left_text()` method to `egui::Button`. It
enables placing additional text content on the left side of the button's
primary label, which is useful for displaying auxiliary information,
labels, and for facilitating left-aligned text within the button.
```rust
let is_selected = true;
let selectable_label_widget = egui::Button::selectable(
is_selected,
"",
).left_text("Left");
let desired_width = ui.available_width();
let desired_height = ui.spacing().interact_size.y;
interaction_response = ui.add_sized(
egui::vec2(desired_width, desired_height),
selectable_label_widget,
);
```