I’m trying to figure out how the new wrapping feature for the text widget works. I’m running the following code and shrinking the window to force text wrapping, but all lines wrap the same as always. The applied wrapping selection doesn’t seem to have any effect.
#[derive(Default)]
pub struct App;
#[derive(Debug)]
pub enum Message {}
use iced::widget::{ Text, Column };
impl App {
fn title(&self) -> String {
return String::from("App");
}
fn update(&mut self, _message: Message) -> iced::Task<Message> {
return iced::Task::none();
}
fn view(&self) -> iced::Element<Message> {
return Column::with_children([
Text::new("hello world").wrapping(iced::widget::text::Wrapping::None).into(),
Text::new("hello world").wrapping(iced::widget::text::Wrapping::Glyph).into(),
Text::new("hello world").wrapping(iced::widget::text::Wrapping::Word).into(),
Text::new("hello world").wrapping(iced::widget::text::Wrapping::WordOrGlyph).into(),
]).into();
}
}
pub fn main() -> iced::Result {
return iced::application(App::title, App::update, App::view).run();
}