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 placement(&self) -> ScrollbarPlacement
pub fn placement(&self) -> ScrollbarPlacement
Where the editor places its scrollbars, as set with
scrollbar_placement, for a supplied scrollbar to follow.
Sourcepub fn content_height_f64(&self) -> f64
pub fn content_height_f64(&self) -> f64
Authoritative vertical content height in f64 pixels (including padding
when combined via scroll_viewport_size).
Sourcepub fn scroll_y_f64(&self) -> f64
pub fn scroll_y_f64(&self) -> f64
Authoritative vertical scroll offset in f64 pixels (<= 0.0).
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>
Source§fn content_size(&self) -> Size<Pixels>
fn content_size(&self) -> Size<Pixels>
Source§fn set_offset(&self, offset: Point<Pixels>)
fn set_offset(&self, offset: Point<Pixels>)
Source§fn start_drag(&self)
fn start_drag(&self)
Auto Trait Implementations§
impl !RefUnwindSafe for EditorScrollbarContext
impl !Send for EditorScrollbarContext
impl !Sync for EditorScrollbarContext
impl !UnwindSafe for EditorScrollbarContext
impl Forget for EditorScrollbarContext
impl Freeze for EditorScrollbarContext
impl Move 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
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,
impl<T> ErasedDestructor for Twhere
T: 'static,
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> ⓘ
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> ⓘ
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