fix: ellipsize
This commit is contained in:
parent
eb6a263e3f
commit
199cc06fa3
2 changed files with 10 additions and 1 deletions
2
iced
2
iced
|
|
@ -1 +1 @@
|
||||||
Subproject commit cc670e1966b2b732e732a020e416f6cfae5bafea
|
Subproject commit c2739eed7c383c8904df1d5d1446d7dbcdb8bd62
|
||||||
|
|
@ -34,6 +34,7 @@ pub struct Toggler<'a, Message> {
|
||||||
spacing: f32,
|
spacing: f32,
|
||||||
font: Option<crate::font::Font>,
|
font: Option<crate::font::Font>,
|
||||||
duration: Duration,
|
duration: Duration,
|
||||||
|
ellipsize: text::Ellipsize,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, Message> Toggler<'a, Message> {
|
impl<'a, Message> Toggler<'a, Message> {
|
||||||
|
|
@ -63,6 +64,7 @@ impl<'a, Message> Toggler<'a, Message> {
|
||||||
spacing: 0.0,
|
spacing: 0.0,
|
||||||
font: None,
|
font: None,
|
||||||
duration: Duration::from_millis(200),
|
duration: Duration::from_millis(200),
|
||||||
|
ellipsize: text::Ellipsize::None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -108,6 +110,12 @@ impl<'a, Message> Toggler<'a, Message> {
|
||||||
self
|
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`]
|
/// Sets the [`Font`] of the text of the [`Toggler`]
|
||||||
///
|
///
|
||||||
/// [`Font`]: cosmic::iced::text::Renderer::Font
|
/// [`Font`]: cosmic::iced::text::Renderer::Font
|
||||||
|
|
@ -188,6 +196,7 @@ impl<'a, Message> Widget<Message, crate::Theme, crate::Renderer> for Toggler<'a,
|
||||||
align_y: alignment::Vertical::Top,
|
align_y: alignment::Vertical::Top,
|
||||||
shaping: self.text_shaping,
|
shaping: self.text_shaping,
|
||||||
wrapping: crate::iced_core::text::Wrapping::default(),
|
wrapping: crate::iced_core::text::Wrapping::default(),
|
||||||
|
ellipsize: self.ellipsize,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
match self.width {
|
match self.width {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue