Depcrecate ui.horizontal_for_text and ui.horizontal_wrapped_for_text
They just add unnecessary complexity at this point
This commit is contained in:
parent
953d2bb39b
commit
eaa1ed96ee
4 changed files with 9 additions and 4 deletions
|
@ -1222,6 +1222,7 @@ impl Ui {
|
|||
/// In particular, the space between widgets is the same width as the space character.
|
||||
///
|
||||
/// You can still add any widgets to the layout (not only Labels).
|
||||
#[deprecated = "Use horizontal instead and set the desired spacing manually with `ui.spacing_mut().item_spacing`"]
|
||||
pub fn horizontal_for_text<R>(
|
||||
&mut self,
|
||||
text_style: TextStyle,
|
||||
|
@ -1266,6 +1267,7 @@ impl Ui {
|
|||
/// and the line spacing is the same as that for text.
|
||||
///
|
||||
/// You can still add any widgets to the layout (not only Labels).
|
||||
#[deprecated = "Use horizontal_wrapped instead and set the desired spacing manually with `ui.spacing_mut().item_spacing`"]
|
||||
pub fn horizontal_wrapped_for_text<R>(
|
||||
&mut self,
|
||||
text_style: TextStyle,
|
||||
|
|
|
@ -176,7 +176,7 @@ impl WidgetGallery {
|
|||
|
||||
ui.add(doc_link_label("CollapsingHeader", "collapsing"));
|
||||
ui.collapsing("Click to see what is hidden!", |ui| {
|
||||
ui.horizontal_wrapped_for_text(egui::TextStyle::Body, |ui| {
|
||||
ui.horizontal_wrapped(|ui| {
|
||||
ui.label(
|
||||
"Not much, as it turns out - but here is a gold star for you for checking:",
|
||||
);
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -285,7 +285,7 @@ impl BackendPanel {
|
|||
"Everything you see is rendered as textured triangles. There is no DOM. There are no HTML elements. \
|
||||
This is not JavaScript. This is Rust, running at 60 FPS. This is the web page, reinvented with game tech.");
|
||||
ui.label("This is also work in progress, and not ready for production... yet :)");
|
||||
ui.horizontal_wrapped_for_text(egui::TextStyle::Body, |ui| {
|
||||
ui.horizontal_wrapped(|ui| {
|
||||
ui.label("Project home page:");
|
||||
ui.hyperlink("https://github.com/emilk/egui");
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue