diff --git a/crates/egui/src/style.rs b/crates/egui/src/style.rs index 2ed9f03f7c9..a610820e99a 100644 --- a/crates/egui/src/style.rs +++ b/crates/egui/src/style.rs @@ -8,7 +8,7 @@ use epaint::{Rounding, Shadow, Stroke}; use crate::{ ecolor::*, emath::*, ComboBox, CursorIcon, FontFamily, FontId, Grid, Margin, Response, - RichText, WidgetText, + RichText, TextWrapMode, WidgetText, }; /// How to format numbers in e.g. a [`crate::DragValue`]. @@ -1501,7 +1501,7 @@ impl Style { drag_value_text_style, number_formatter: _, // can't change callbacks in the UI wrap: _, - wrap_mode: _, + wrap_mode, spacing, interaction, visuals, @@ -1561,6 +1561,23 @@ impl Style { }); ui.end_row(); + ui.label("Text Wrap Mode"); + crate::ComboBox::from_id_source("text_wrap_mode") + .selected_text(format!("{wrap_mode:?}")) + .show_ui(ui, |ui| { + let all_wrap_mode: Vec> = vec![ + None, + Some(TextWrapMode::Extend), + Some(TextWrapMode::Wrap), + Some(TextWrapMode::Truncate), + ]; + for style in all_wrap_mode { + let text = crate::RichText::new(format!("{style:?}")); + ui.selectable_value(wrap_mode, style, text); + } + }); + ui.end_row(); + ui.label("Animation duration"); ui.add( DragValue::new(animation_time)