pub struct ScrollCustomStyle(/* private fields */);Expand description
Represents a custom style for a Scroll.
Implementations§
Source§impl ScrollCustomStyle
impl ScrollCustomStyle
Sourcepub fn new() -> ScrollCustomStyle
pub fn new() -> ScrollCustomStyle
Creates a new ScrollCustomStyle.
Sourcepub fn shrink_to_fit(self) -> ScrollCustomStyle
pub fn shrink_to_fit(self) -> ScrollCustomStyle
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 handle_background(self, color: impl Into<Brush>) -> ScrollCustomStyle
pub fn handle_background(self, color: impl Into<Brush>) -> ScrollCustomStyle
Sets the background color for the handle.
Sourcepub fn handle_border_radius(
self,
border_radius: impl Into<Length>,
) -> ScrollCustomStyle
pub fn handle_border_radius( self, border_radius: impl Into<Length>, ) -> ScrollCustomStyle
Sets the border radius for the handle.
Sourcepub fn handle_border_color(
self,
border_color: impl Into<Brush>,
) -> ScrollCustomStyle
pub fn handle_border_color( self, border_color: impl Into<Brush>, ) -> ScrollCustomStyle
Sets the border color for the handle.
Sourcepub fn handle_border(self, border: impl Into<Pt>) -> ScrollCustomStyle
pub fn handle_border(self, border: impl Into<Pt>) -> ScrollCustomStyle
Sets the border thickness for the handle.
Sourcepub fn handle_rounded(self, rounded: impl Into<bool>) -> ScrollCustomStyle
pub fn handle_rounded(self, rounded: impl Into<bool>) -> ScrollCustomStyle
Sets whether the handle should have rounded corners.
Sourcepub fn track_background(self, color: impl Into<Brush>) -> ScrollCustomStyle
pub fn track_background(self, color: impl Into<Brush>) -> ScrollCustomStyle
Sets the background color for the track.
Sourcepub fn track_border_radius(
self,
border_radius: impl Into<Length>,
) -> ScrollCustomStyle
pub fn track_border_radius( self, border_radius: impl Into<Length>, ) -> ScrollCustomStyle
Sets the border radius for the track.
Sourcepub fn track_border_color(
self,
border_color: impl Into<Brush>,
) -> ScrollCustomStyle
pub fn track_border_color( self, border_color: impl Into<Brush>, ) -> ScrollCustomStyle
Sets the border color for the track.
Sourcepub fn track_border(self, border: impl Into<Pt>) -> ScrollCustomStyle
pub fn track_border(self, border: impl Into<Pt>) -> ScrollCustomStyle
Sets the border thickness for the track.
Sourcepub fn track_rounded(self, rounded: impl Into<bool>) -> ScrollCustomStyle
pub fn track_rounded(self, rounded: impl Into<bool>) -> ScrollCustomStyle
Sets whether the track should have rounded corners.
Sourcepub fn vertical_track_inset(self, inset: impl Into<Pt>) -> ScrollCustomStyle
pub fn vertical_track_inset(self, inset: impl Into<Pt>) -> ScrollCustomStyle
Sets the vertical track inset.
Sourcepub fn horizontal_track_inset(self, inset: impl Into<Pt>) -> ScrollCustomStyle
pub fn horizontal_track_inset(self, inset: impl Into<Pt>) -> ScrollCustomStyle
Sets the horizontal track inset.
Sourcepub fn hide_bars(self, hide: impl Into<bool>) -> ScrollCustomStyle
pub fn hide_bars(self, hide: impl Into<bool>) -> ScrollCustomStyle
Controls the visibility of the scroll bars.
Sourcepub fn propagate_pointer_wheel(
self,
propagate: impl Into<bool>,
) -> ScrollCustomStyle
pub fn propagate_pointer_wheel( self, propagate: impl Into<bool>, ) -> ScrollCustomStyle
Sets whether the pointer wheel events should be propagated.
Sourcepub fn vertical_scroll_as_horizontal(
self,
vert_as_horiz: impl Into<bool>,
) -> ScrollCustomStyle
pub fn vertical_scroll_as_horizontal( self, vert_as_horiz: impl Into<bool>, ) -> ScrollCustomStyle
Sets whether vertical scrolling should be interpreted as horizontal scrolling.
Sourcepub fn show_bars_when_idle(self, show: impl Into<bool>) -> ScrollCustomStyle
pub fn show_bars_when_idle(self, show: impl Into<bool>) -> ScrollCustomStyle
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 focus_within(self, style: impl FnOnce(Self) -> Self) -> Self
fn focus_within(self, style: impl FnOnce(Self) -> Self) -> Self
:focus-within css selector, this style activates when this
view or any descendant is in the focus path.Source§fn first_child(self, style: impl FnOnce(Self) -> Self) -> Self
fn first_child(self, style: impl FnOnce(Self) -> Self) -> Self
:first-child css selector.Source§fn last_child(self, style: impl FnOnce(Self) -> Self) -> Self
fn last_child(self, style: impl FnOnce(Self) -> Self) -> Self
:last-child css selector.Source§fn nth_child(self, nth: NthChild, style: impl FnOnce(Self) -> Self) -> Self
fn nth_child(self, nth: NthChild, style: impl FnOnce(Self) -> Self) -> Self
:nth-child(...) css selector.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 min_window_width(
self,
min: impl Into<Pt>,
style: impl FnOnce(Self) -> Self,
) -> Self
fn min_window_width( self, min: impl Into<Pt>, style: impl FnOnce(Self) -> Self, ) -> Self
min.Source§fn max_window_width(
self,
max: impl Into<Pt>,
style: impl FnOnce(Self) -> Self,
) -> Self
fn max_window_width( self, max: impl Into<Pt>, style: impl FnOnce(Self) -> Self, ) -> Self
max.Source§fn window_width_range(
self,
min: impl Into<Pt>,
max: impl Into<Pt>,
style: impl FnOnce(Self) -> Self,
) -> Self
fn window_width_range( self, min: impl Into<Pt>, max: impl Into<Pt>, style: impl FnOnce(Self) -> Self, ) -> Self
[min, max] (inclusive).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>(self, _prop: P, transition: Transition) -> Selfwhere
P: StyleProp,
fn transition<P>(self, _prop: P, transition: Transition) -> Selfwhere
P: StyleProp,
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<Style> for ScrollCustomStyle
impl From<Style> for ScrollCustomStyle
Source§fn from(value: Style) -> ScrollCustomStyle
fn from(value: Style) -> ScrollCustomStyle
Auto Trait Implementations§
impl Freeze for ScrollCustomStyle
impl !RefUnwindSafe for ScrollCustomStyle
impl !Send for ScrollCustomStyle
impl !Sync for ScrollCustomStyle
impl Unpin for ScrollCustomStyle
impl UnsafeUnpin 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> 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().