pub struct TextPathSegmentEllipsis { /* private fields */ }Expand description
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.
Implementations§
Source§impl TextPathSegmentEllipsis
impl TextPathSegmentEllipsis
Sourcepub fn new(
ellipsis: &str,
width: f64,
text_run_properties: Rc<dyn TextRunProperties>,
flow_direction: FlowDirection,
) -> Self
pub 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.
Trait Implementations§
Source§impl TextCollapsingProperties for TextPathSegmentEllipsis
impl TextCollapsingProperties for TextPathSegmentEllipsis
Source§fn flow_direction(&self) -> FlowDirection
fn flow_direction(&self) -> FlowDirection
Gets the flow direction that is used for collapsing.
Auto Trait Implementations§
impl !RefUnwindSafe for TextPathSegmentEllipsis
impl !Send for TextPathSegmentEllipsis
impl !Sync for TextPathSegmentEllipsis
impl !UnwindSafe for TextPathSegmentEllipsis
impl Freeze for TextPathSegmentEllipsis
impl Unpin for TextPathSegmentEllipsis
impl UnsafeUnpin for TextPathSegmentEllipsis
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
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
The static constructor of a type: work done once per thread, after
the properties of the type are registered and before its first
instance exists (class handlers,
affects_render, metadata
overrides). Read more