pub struct Segment { /* private fields */ }Expand description
A single segment inside a SegmentedControl.
Build with Segment::text, Segment::icon, or
Segment::icon_text, then layer optional decorations with
Segment::dot and Segment::count. Mark unavailable segments
with Segment::enabled.
let seg = Segment::text("Open").dot(SegmentDot::Amber).count("12");Implementations§
Source§impl Segment
impl Segment
Sourcepub fn text(label: impl Into<WidgetText>) -> Self
pub fn text(label: impl Into<WidgetText>) -> Self
Text-only segment.
Sourcepub fn icon(icon: impl Into<WidgetText>) -> Self
pub fn icon(icon: impl Into<WidgetText>) -> Self
Icon-only segment. The icon is any WidgetText — typically a
glyph from elegance::glyphs wrapped in
egui::RichText.
Sourcepub fn icon_text(
icon: impl Into<WidgetText>,
label: impl Into<WidgetText>,
) -> Self
pub fn icon_text( icon: impl Into<WidgetText>, label: impl Into<WidgetText>, ) -> Self
Icon + label segment. The icon precedes the label.
Sourcepub fn count(self, count: impl Into<WidgetText>) -> Self
pub fn count(self, count: impl Into<WidgetText>) -> Self
Add a count badge that follows the label.
Sourcepub fn dot(self, dot: SegmentDot) -> Self
pub fn dot(self, dot: SegmentDot) -> Self
Add a leading status dot.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Segment
impl RefUnwindSafe for Segment
impl Send for Segment
impl Sync for Segment
impl Unpin for Segment
impl UnsafeUnpin for Segment
impl UnwindSafe for Segment
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more