mirror of
https://github.com/emilk/egui.git
synced 2026-09-01 22:30:03 -04:00
Depcrecate ui.horizontal_for_text and ui.horizontal_wrapped_for_text
They just add unnecessary complexity at this point
This commit is contained in:
@@ -46,7 +46,10 @@ impl Widgets {
|
||||
ui.add(crate::__egui_github_link_file_line!());
|
||||
});
|
||||
|
||||
ui.horizontal_wrapped_for_text(TextStyle::Body, |ui| {
|
||||
ui.horizontal_wrapped(|ui| {
|
||||
// Trick so we don't have to add spaces in the text below:
|
||||
ui.spacing_mut().item_spacing.x = ui.fonts()[TextStyle::Body].glyph_width(' ');
|
||||
|
||||
ui.add(Label::new("Text can have").text_color(Color32::from_rgb(110, 255, 110)));
|
||||
ui.colored_label(Color32::from_rgb(128, 140, 255), "color"); // Shortcut version
|
||||
ui.label("and tooltips.").on_hover_text(
|
||||
@@ -104,7 +107,7 @@ impl Widgets {
|
||||
|
||||
ui.separator();
|
||||
|
||||
ui.horizontal_for_text(TextStyle::Body, |ui| {
|
||||
ui.horizontal(|ui| {
|
||||
ui.label("An angle:");
|
||||
ui.drag_angle(&mut self.angle);
|
||||
ui.label(format!("≈ {:.3}τ", self.angle / std::f32::consts::TAU))
|
||||
|
||||
Reference in New Issue
Block a user