pub struct ScrollCustomStyle(/* private fields */);Expand description
Represents a custom style for a Scroll.
Implementations§
Source§impl ScrollCustomStyle
impl ScrollCustomStyle
Sourcepub fn shrink_to_fit(self) -> Self
pub fn shrink_to_fit(self) -> Self
Configures the scroll view to allow the viewport to be smaller than the inner content, while still taking up the full available space in its container.
Use this when you need a scroll view that can shrink its viewport size to fit within the container, ensuring the content remains scrollable even if the inner content is greater than the parent size.
Internally this does a s.min_size(0., 0.).size_full().
Sourcepub fn overflow_clip(self, clip: bool) -> Self
pub fn overflow_clip(self, clip: bool) -> Self
Conditionally configures the scroll view to clip the overflow of the content.
Sourcepub fn handle_background(self, color: impl Into<Brush>) -> Self
pub fn handle_background(self, color: impl Into<Brush>) -> Self
Sets the background color for the handle.
Sourcepub fn handle_border_radius(self, border_radius: impl Into<PxPct>) -> Self
pub fn handle_border_radius(self, border_radius: impl Into<PxPct>) -> Self
Sets the border radius for the handle.
Sourcepub fn handle_border_color(self, border_color: impl Into<Brush>) -> Self
pub fn handle_border_color(self, border_color: impl Into<Brush>) -> Self
Sets the border color for the handle.
Sourcepub fn handle_border(self, border: impl Into<Px>) -> Self
pub fn handle_border(self, border: impl Into<Px>) -> Self
Sets the border thickness for the handle.
Sourcepub fn handle_rounded(self, rounded: impl Into<bool>) -> Self
pub fn handle_rounded(self, rounded: impl Into<bool>) -> Self
Sets whether the handle should have rounded corners.
Sourcepub fn handle_thickness(self, thickness: impl Into<Px>) -> Self
pub fn handle_thickness(self, thickness: impl Into<Px>) -> Self
Sets the thickness of the handle.
Sourcepub fn track_background(self, color: impl Into<Brush>) -> Self
pub fn track_background(self, color: impl Into<Brush>) -> Self
Sets the background color for the track.
Sourcepub fn track_border_radius(self, border_radius: impl Into<PxPct>) -> Self
pub fn track_border_radius(self, border_radius: impl Into<PxPct>) -> Self
Sets the border radius for the track.
Sourcepub fn track_border_color(self, border_color: impl Into<Brush>) -> Self
pub fn track_border_color(self, border_color: impl Into<Brush>) -> Self
Sets the border color for the track.
Sourcepub fn track_border(self, border: impl Into<Px>) -> Self
pub fn track_border(self, border: impl Into<Px>) -> Self
Sets the border thickness for the track.
Sourcepub fn track_rounded(self, rounded: impl Into<bool>) -> Self
pub fn track_rounded(self, rounded: impl Into<bool>) -> Self
Sets whether the track should have rounded corners.
Sourcepub fn track_thickness(self, thickness: impl Into<Px>) -> Self
pub fn track_thickness(self, thickness: impl Into<Px>) -> Self
Sets the thickness of the track.
Sourcepub fn vertical_track_inset(self, inset: impl Into<Px>) -> Self
pub fn vertical_track_inset(self, inset: impl Into<Px>) -> Self
Sets the vertical track inset.
Sourcepub fn horizontal_track_inset(self, inset: impl Into<Px>) -> Self
pub fn horizontal_track_inset(self, inset: impl Into<Px>) -> Self
Sets the horizontal track inset.
Sourcepub fn hide_bars(self, hide: impl Into<bool>) -> Self
pub fn hide_bars(self, hide: impl Into<bool>) -> Self
Controls the visibility of the scroll bars.
Sourcepub fn propagate_pointer_wheel(self, propagate: impl Into<bool>) -> Self
pub fn propagate_pointer_wheel(self, propagate: impl Into<bool>) -> Self
Sets whether the pointer wheel events should be propagated.
Sourcepub fn vertical_scroll_as_horizontal(
self,
vert_as_horiz: impl Into<bool>,
) -> Self
pub fn vertical_scroll_as_horizontal( self, vert_as_horiz: impl Into<bool>, ) -> Self
Sets whether vertical scrolling should be interpreted as horizontal scrolling.
Sourcepub fn show_bars_when_idle(self, show: impl Into<bool>) -> Self
pub fn show_bars_when_idle(self, show: impl Into<bool>) -> Self
Controls whether scroll bars are shown when not scrolling. When false, bars are only shown during scroll interactions.
Trait Implementations§
Source§impl Clone for ScrollCustomStyle
impl Clone for ScrollCustomStyle
Source§fn clone(&self) -> ScrollCustomStyle
fn clone(&self) -> ScrollCustomStyle
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl CustomStylable<ScrollCustomStyle> for Scroll
impl CustomStylable<ScrollCustomStyle> for Scroll
Source§impl CustomStyle for ScrollCustomStyle
impl CustomStyle for ScrollCustomStyle
Source§type StyleClass = ScrollClass
type StyleClass = ScrollClass
Source§fn style(self, style: impl FnOnce(Style) -> Style) -> Self
fn style(self, style: impl FnOnce(Style) -> Style) -> Self
Source§fn hover(self, style: impl FnOnce(Self) -> Self) -> Self
fn hover(self, style: impl FnOnce(Self) -> Self) -> Self
Source§fn focus(self, style: impl FnOnce(Self) -> Self) -> Self
fn focus(self, style: impl FnOnce(Self) -> Self) -> Self
Source§fn focus_visible(self, style: impl FnOnce(Self) -> Self) -> Self
fn focus_visible(self, style: impl FnOnce(Self) -> Self) -> Self
:focus-visible css selector, this style only activates when tab navigation is used.Source§fn selected(self, style: impl FnOnce(Self) -> Self) -> Self
fn selected(self, style: impl FnOnce(Self) -> Self) -> Self
Source§fn disabled(self, style: impl FnOnce(Self) -> Self) -> Self
fn disabled(self, style: impl FnOnce(Self) -> Self) -> Self
Source§fn dark_mode(self, style: impl FnOnce(Self) -> Self) -> Self
fn dark_mode(self, style: impl FnOnce(Self) -> Self) -> Self
Source§fn active(self, style: impl FnOnce(Self) -> Self) -> Self
fn active(self, style: impl FnOnce(Self) -> Self) -> Self
Source§fn responsive(self, size: ScreenSize, style: impl FnOnce(Self) -> Self) -> Self
fn responsive(self, size: ScreenSize, style: impl FnOnce(Self) -> Self) -> Self
Source§fn apply_if(self, cond: bool, style: impl FnOnce(Self) -> Self) -> Self
fn apply_if(self, cond: bool, style: impl FnOnce(Self) -> Self) -> Self
Source§fn apply_opt<T>(self, opt: Option<T>, f: impl FnOnce(Self, T) -> Self) -> Self
fn apply_opt<T>(self, opt: Option<T>, f: impl FnOnce(Self, T) -> Self) -> Self
Source§fn transition<P: StyleProp>(self, _prop: P, transition: Transition) -> Self
fn transition<P: StyleProp>(self, _prop: P, transition: Transition) -> Self
Source§impl Debug for ScrollCustomStyle
impl Debug for ScrollCustomStyle
Source§impl Default for ScrollCustomStyle
impl Default for ScrollCustomStyle
Source§fn default() -> ScrollCustomStyle
fn default() -> ScrollCustomStyle
Source§impl From<ScrollCustomStyle> for Style
impl From<ScrollCustomStyle> for Style
Source§fn from(value: ScrollCustomStyle) -> Self
fn from(value: ScrollCustomStyle) -> Self
Auto Trait Implementations§
impl Freeze for ScrollCustomStyle
impl !RefUnwindSafe for ScrollCustomStyle
impl !Send for ScrollCustomStyle
impl !Sync for ScrollCustomStyle
impl Unpin for ScrollCustomStyle
impl !UnwindSafe for ScrollCustomStyle
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
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