pub struct ScrollbarTokens { /* private fields */ }Expand description
The crate’s scrollbar policy, replaceable before any window renders.
Defaults, then the application’s policy, then a component’s own builder — the same order every other policy in the library follows.
§Example
gpui_ai::init(cx);
gpui_ai::scrolling::ScrollbarTokens::default()
.with_visibility(gpui_ai::scrolling::ScrollbarVisibility::Scrolling)
.set(cx);Implementations§
Source§impl ScrollbarTokens
impl ScrollbarTokens
Sourcepub const DEFAULT: Self
pub const DEFAULT: Self
The crate’s default scrollbar policy: always visible, overlaid.
Always, because a surface that scrolls should look like one before the reader touches it; overlaid, because reserving a gutter narrows content that usually does not need it.
Sourcepub fn set(self, cx: &mut App)
pub fn set(self, cx: &mut App)
Makes this policy the application’s, for every surface at once.
The choice is projected onto the theme’s own scrollbar mode, which is what every bar resolves from when nothing overrides it — the crate’s surfaces and the bars upstream draws inside its tables alike, and the crate re-projects it when it initializes.
Sourcepub const fn visibility(&self) -> ScrollbarVisibility
pub const fn visibility(&self) -> ScrollbarVisibility
When scrollbars show.
Sourcepub const fn placement(&self) -> ScrollbarPlacement
pub const fn placement(&self) -> ScrollbarPlacement
Whether scrollbars overlay content or reserve a gutter.
Sourcepub const fn with_visibility(self, visibility: ScrollbarVisibility) -> Self
pub const fn with_visibility(self, visibility: ScrollbarVisibility) -> Self
Replaces the visibility.
Sourcepub const fn with_placement(self, placement: ScrollbarPlacement) -> Self
pub const fn with_placement(self, placement: ScrollbarPlacement) -> Self
Replaces the placement.
Trait Implementations§
Source§impl Clone for ScrollbarTokens
impl Clone for ScrollbarTokens
Source§fn clone(&self) -> ScrollbarTokens
fn clone(&self) -> ScrollbarTokens
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ScrollbarTokens
Source§impl Debug for ScrollbarTokens
impl Debug for ScrollbarTokens
Source§impl Default for ScrollbarTokens
impl Default for ScrollbarTokens
impl Eq for ScrollbarTokens
impl Global for ScrollbarTokens
Source§impl PartialEq for ScrollbarTokens
impl PartialEq for ScrollbarTokens
impl StructuralPartialEq for ScrollbarTokens
Auto Trait Implementations§
impl Freeze for ScrollbarTokens
impl RefUnwindSafe for ScrollbarTokens
impl Send for ScrollbarTokens
impl Sync for ScrollbarTokens
impl Unpin for ScrollbarTokens
impl UnsafeUnpin for ScrollbarTokens
impl UnwindSafe for ScrollbarTokens
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Span], returning an
Instrumented wrapper.§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§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> ReadGlobal for Twhere
T: Global,
impl<T> ReadGlobal for Twhere
T: Global,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().§impl<T> UpdateGlobal for Twhere
T: Global,
impl<T> UpdateGlobal for Twhere
T: Global,
§fn update_global<C, F, R>(cx: &mut C, update: F) -> R
fn update_global<C, F, R>(cx: &mut C, update: F) -> R
§fn set_global<C>(cx: &mut C, global: T)where
C: BorrowAppContext,
fn set_global<C>(cx: &mut C, global: T)where
C: BorrowAppContext,
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
Subscriber to this type, returning a
[WithDispatch] wrapper.