FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    TextPathSegmentEllipsis

    struct · ferroui-base · v0.5.0

    struct TextPathSegmentEllipsis
    

    Provides text collapsing properties that replace the middle segments of a file path with an ellipsis symbol when the rendered width exceeds a specified limit.

    This class is typically used to display file paths in a compact form by collapsing segments near the center and inserting an ellipsis, ensuring that the most relevant parts of the path remain visible. It is suitable for scenarios where space is limited, such as UI elements that display file or directory paths. The collapsing behavior prioritizes preserving the beginning and end segments of the path.

    View source

    Members

    new

    fn new(ellipsis: &str, width: f64, text_run_properties: Rc<dyn TextRunProperties>, flow_direction: FlowDirection) -> Self
    

    Initializes a new instance with the specified ellipsis symbol, maximum width, text run properties, and flow direction.

    • ellipsis — the string to use as the ellipsis symbol when collapsing path segments.
    • width — the maximum width, in device-independent pixels, within which the text must fit.
    • text_run_properties — the text formatting properties to apply to the ellipsis symbol.
    • flow_direction — the flow direction for text layout.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ErasedDestructor
    • IntoEither
    • TextCollapsingProperties

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.