pub enum Scroller {
Pane(ScrollHandle),
List(ListState),
}Expand description
What a bar, a follow or a drag region reads and moves: a scrolling div’s
ScrollHandle or a gpui::list’s ListState, in the handle’s terms
— offset negative going down, max_offset the overflow.
A list counts only the items it has measured: one never laid out adds
nothing to max_offset, so both readings grow as the list is scrolled
through. A list’s offset is vertical only.
offset never reads past max_offset. A div’s wheel handler moves its
handle past the end and the div clamps it when next laid out, so a raw
read before that layout is where the content will not be drawn.
Variants§
Pane(ScrollHandle)
List(ListState)
Implementations§
Source§impl Scroller
impl Scroller
pub fn offset(&self) -> Point<Pixels>
pub fn max_offset(&self) -> Point<Pixels>
Sourcepub fn set_offset(&self, offset: Point<Pixels>)
pub fn set_offset(&self, offset: Point<Pixels>)
Takes effect at the next layout. A list clamps to what it has measured.
Sourcepub fn scroll_to_end(&self)
pub fn scroll_to_end(&self)
Past the last of the content. A list anchors on its last item and lays out backwards from it, so the end is reached in one frame however much of it is unmeasured.
Trait Implementations§
Source§impl From<&ScrollHandle> for Scroller
impl From<&ScrollHandle> for Scroller
Source§fn from(handle: &ScrollHandle) -> Self
fn from(handle: &ScrollHandle) -> Self
Source§impl From<ScrollHandle> for Scroller
impl From<ScrollHandle> for Scroller
Source§fn from(handle: ScrollHandle) -> Self
fn from(handle: ScrollHandle) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for Scroller
impl !Send for Scroller
impl !Sync for Scroller
impl !UnwindSafe for Scroller
impl Freeze for Scroller
impl Unpin for Scroller
impl UnsafeUnpin for Scroller
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,
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