pub struct Scroll {
pub rows: u32,
pub fixed_top: u32,
pub fixed_bottom: u32,
}Expand description
A cells surface taller than where it shows (set_scroll): the viewer
scrolls the rows between the fixed ones with its own motion.
Fields§
§rows: u32The rows the plugin paints (at most Scroll::MAX_ROWS): the
surface’s height while it is at least as tall as where it shows.
fixed_top: u32Rows at the top that stay in place: a title or a toolbar.
fixed_bottom: u32Rows at the bottom that stay in place, at the bottom of where the surface shows: a status line or key hints.
Implementations§
Source§impl Scroll
impl Scroll
Sourcepub const fn rows(rows: u32) -> Self
pub const fn rows(rows: u32) -> Self
rows rows that all scroll.
Examples found in repository?
More examples
examples/scroll_list.rs (line 91)
87 fn activate(_cx: &mut Context) -> Self {
88 let list = Surface::new("list");
89 // Call it again when the content's height changes. It stays in force.
90 let _ = list.set_scroll(Some(
91 Scroll::rows(TITLE_ROWS + ITEMS + HINT_ROWS).fixed(TITLE_ROWS, HINT_ROWS),
92 ));
93 Self {
94 list,
95 selected: 0,
96 dirty: true,
97 }
98 }Sourcepub const fn fixed(self, top: u32, bottom: u32) -> Self
pub const fn fixed(self, top: u32, bottom: u32) -> Self
The same rows with top rows fixed above and bottom rows fixed
below the scrolling ones.
Examples found in repository?
More examples
examples/scroll_list.rs (line 91)
87 fn activate(_cx: &mut Context) -> Self {
88 let list = Surface::new("list");
89 // Call it again when the content's height changes. It stays in force.
90 let _ = list.set_scroll(Some(
91 Scroll::rows(TITLE_ROWS + ITEMS + HINT_ROWS).fixed(TITLE_ROWS, HINT_ROWS),
92 ));
93 Self {
94 list,
95 selected: 0,
96 dirty: true,
97 }
98 }Trait Implementations§
impl Copy for Scroll
impl Eq for Scroll
impl StructuralPartialEq for Scroll
Auto Trait Implementations§
impl Forget for Scroll
impl Freeze for Scroll
impl Move for Scroll
impl RefUnwindSafe for Scroll
impl Send for Scroll
impl Sync for Scroll
impl Unpin for Scroll
impl UnsafeUnpin for Scroll
impl UnwindSafe for Scroll
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