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.
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
type StyleClass = ScrollClass
fn hover(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.fn selected(self, style: impl FnOnce(Self) -> Self) -> Self
fn disabled(self, style: impl FnOnce(Self) -> Self) -> Self
fn dark_mode(self, style: impl FnOnce(Self) -> Self) -> Self
fn active(self, style: impl FnOnce(Self) -> Self) -> Self
fn responsive(self, size: ScreenSize, style: impl FnOnce(Self) -> Self) -> Self
fn apply_if(self, cond: bool, style: impl FnOnce(Self) -> Self) -> 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,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
§impl<T> Pointable for T
impl<T> Pointable for T
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()
.