feat: ellipsize text (#1132)

This commit is contained in:
Hojjat Abdollahi 2026-02-19 10:06:45 -07:00 committed by GitHub
parent 1f6086e5ea
commit b9bd773940
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 20 additions and 2 deletions

View file

@ -728,6 +728,7 @@ where
line_height: text::LineHeight::default(),
shaping: text::Shaping::Advanced,
wrapping: text::Wrapping::None,
ellipsize: text::Ellipsize::None,
});
let Size { width, height } =
@ -1160,6 +1161,7 @@ pub fn layout<Message>(
line_height,
shaping: text::Shaping::Advanced,
wrapping: text::Wrapping::None,
ellipsize: text::Ellipsize::None,
});
let label_size = label_paragraph.min_bounds();
@ -1297,6 +1299,7 @@ pub fn layout<Message>(
line_height: helper_text_line_height,
shaping: text::Shaping::Advanced,
wrapping: text::Wrapping::None,
ellipsize: text::Ellipsize::None,
});
let helper_text_size = helper_text_paragraph.min_bounds();
let helper_text_node = layout::Node::new(helper_text_size).translate(helper_pos);
@ -2260,6 +2263,7 @@ pub fn draw<'a, Message>(
line_height,
shaping: text::Shaping::Advanced,
wrapping: text::Wrapping::None,
ellipsize: text::Ellipsize::None,
},
label_layout.bounds().position(),
appearance.label_color,
@ -2449,6 +2453,7 @@ pub fn draw<'a, Message>(
line_height: text::LineHeight::default(),
shaping: text::Shaping::Advanced,
wrapping: text::Wrapping::None,
ellipsize: text::Ellipsize::None,
},
bounds.position(),
color,
@ -2497,6 +2502,7 @@ pub fn draw<'a, Message>(
line_height: helper_line_height,
shaping: text::Shaping::Advanced,
wrapping: text::Wrapping::None,
ellipsize: text::Ellipsize::None,
},
helper_text_layout.bounds().position(),
text_color,
@ -2877,6 +2883,7 @@ fn replace_paragraph(
vertical_alignment: alignment::Vertical::Top,
shaping: text::Shaping::Advanced,
wrapping: text::Wrapping::None,
ellipsize: text::Ellipsize::None,
});
}