From 199cc06fa3a7eb8c8eebc74b756e3b079e139827 Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Thu, 19 Feb 2026 22:54:08 -0500 Subject: [PATCH] fix: ellipsize --- iced | 2 +- src/widget/toggler.rs | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/iced b/iced index cc670e19..c2739eed 160000 --- a/iced +++ b/iced @@ -1 +1 @@ -Subproject commit cc670e1966b2b732e732a020e416f6cfae5bafea +Subproject commit c2739eed7c383c8904df1d5d1446d7dbcdb8bd62 diff --git a/src/widget/toggler.rs b/src/widget/toggler.rs index fafc6d70..312b50d5 100644 --- a/src/widget/toggler.rs +++ b/src/widget/toggler.rs @@ -34,6 +34,7 @@ pub struct Toggler<'a, Message> { spacing: f32, font: Option, duration: Duration, + ellipsize: text::Ellipsize, } impl<'a, Message> Toggler<'a, Message> { @@ -63,6 +64,7 @@ impl<'a, Message> Toggler<'a, Message> { spacing: 0.0, font: None, duration: Duration::from_millis(200), + ellipsize: text::Ellipsize::None, } } @@ -108,6 +110,12 @@ impl<'a, Message> Toggler<'a, Message> { self } + /// Sets the [`text::Ellipsize`] strategy of the [`Toggler`]. + pub fn ellipsize(mut self, ellipsize: text::Ellipsize) -> Self { + self.ellipsize = ellipsize; + self + } + /// Sets the [`Font`] of the text of the [`Toggler`] /// /// [`Font`]: cosmic::iced::text::Renderer::Font @@ -188,6 +196,7 @@ impl<'a, Message> Widget for Toggler<'a, align_y: alignment::Vertical::Top, shaping: self.text_shaping, wrapping: crate::iced_core::text::Wrapping::default(), + ellipsize: self.ellipsize, }, ); match self.width {