pub struct EditorScrollbarContext { /* private fields */ }Expand description
Current-frame editor geometry and its retained scroll offset.
The editor applies caret scrolling before invoking the presentation callback.
Like other ScrollbarHandle implementations, the content size includes
the viewport’s padding, so subtracting the track size gives the scroll range.
Implementations§
Source§impl EditorScrollbarContext
impl EditorScrollbarContext
pub fn axis(&self) -> ScrollbarAxis
Sourcepub fn scroll_viewport_size(&self) -> Size<Pixels>
pub fn scroll_viewport_size(&self) -> Size<Pixels>
The editor’s viewport without padding, for consumers that need its
text layout size. Scrollbars should use ScrollbarHandle::content_size
and ScrollbarHandle::viewport_bounds to calculate the scroll range;
both include the padding around this viewport.
Trait Implementations§
Source§impl Clone for EditorScrollbarContext
impl Clone for EditorScrollbarContext
Source§impl ScrollbarHandle for EditorScrollbarContext
impl ScrollbarHandle for EditorScrollbarContext
Source§fn viewport_bounds(&self) -> Bounds<Pixels>
fn viewport_bounds(&self) -> Bounds<Pixels>
Bounds of the viewport the scrollbar overlays.
Source§fn content_size(&self) -> Size<Pixels>
fn content_size(&self) -> Size<Pixels>
The full size of the content, including padding.
Source§fn set_offset(&self, offset: Point<Pixels>)
fn set_offset(&self, offset: Point<Pixels>)
Set the offset of the scroll handle.
Source§fn start_drag(&self)
fn start_drag(&self)
Called when start dragging the scrollbar thumb.
Auto Trait Implementations§
impl !RefUnwindSafe for EditorScrollbarContext
impl !Send for EditorScrollbarContext
impl !Sync for EditorScrollbarContext
impl !UnwindSafe for EditorScrollbarContext
impl Freeze for EditorScrollbarContext
impl Unpin for EditorScrollbarContext
impl UnsafeUnpin for EditorScrollbarContext
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more