pub struct ScrollEdgeArrow<C> { /* private fields */ }Expand description
A strip that scrolls, with an arrow over a fade at each end that has more to show. The arrow scrolls most of the strip at a time, and leaves when that end is reached.
The strip is horizontal unless ScrollEdgeArrow::vertical. Children keep their size
when they have one, so give them a width: without it they share the room first, as in any
row, down to what their content needs. Every scroll builds the strip again to know
whether an arrow still applies, so what goes in should be cheap to build.
use ravenrs_widgets::{Button, ScrollEdgeArrow, Ui};
let photos: Vec<Button> = (1..=30).map(|n| Button::new(format!("Photo {n}"))).collect();
let strip = ScrollEdgeArrow::new(photos).spacing(8.0);
let mut ui = Ui::new(strip, ravenrs_style::Theme::raven_dark());
ui.update();Implementations§
Source§impl<C: ViewSeq> ScrollEdgeArrow<C>
impl<C: ViewSeq> ScrollEdgeArrow<C>
Sourcepub fn new(children: C) -> Self
pub fn new(children: C) -> Self
A horizontal strip of children (a tuple of up to 12 views or a Vec).
Sourcepub fn spacing(self, spacing: f32) -> Self
pub fn spacing(self, spacing: f32) -> Self
Gap between children, in logical pixels (default 8).
Trait Implementations§
Source§impl<C> Debug for ScrollEdgeArrow<C>
impl<C> Debug for ScrollEdgeArrow<C>
Auto Trait Implementations§
impl<C> Freeze for ScrollEdgeArrow<C>where
C: Freeze,
impl<C> RefUnwindSafe for ScrollEdgeArrow<C>where
C: RefUnwindSafe,
impl<C> Send for ScrollEdgeArrow<C>where
C: Send,
impl<C> Sync for ScrollEdgeArrow<C>where
C: Sync,
impl<C> Unpin for ScrollEdgeArrow<C>where
C: Unpin,
impl<C> UnsafeUnpin for ScrollEdgeArrow<C>where
C: UnsafeUnpin,
impl<C> UnwindSafe for ScrollEdgeArrow<C>where
C: UnwindSafe,
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
Mutably borrows from an owned value. Read more
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<V> ViewExt for Vwhere
V: View,
impl<V> ViewExt for Vwhere
V: View,
Source§fn padding(self, padding: impl Into<Insets>) -> Styled<Self>
fn padding(self, padding: impl Into<Insets>) -> Styled<Self>
Adds padding inside the box, in logical pixels.
Source§fn background(self, fill: impl Into<Fill>) -> Styled<Self>
fn background(self, fill: impl Into<Fill>) -> Styled<Self>
Paints a background behind the content.
Source§fn frame(self, width: Option<f32>, height: Option<f32>) -> Styled<Self>
fn frame(self, width: Option<f32>, height: Option<f32>) -> Styled<Self>
Fixes the width and/or height in logical pixels;
None keeps the content size.