Add auto_scroll method to scrollable widget
This commit is contained in:
parent
71e57fe889
commit
519e7ae414
4 changed files with 29 additions and 9 deletions
|
|
@ -210,7 +210,8 @@ impl ScrollableDemo {
|
|||
.width(Fill)
|
||||
.height(Fill)
|
||||
.id(SCROLLABLE)
|
||||
.on_scroll(Message::Scrolled),
|
||||
.on_scroll(Message::Scrolled)
|
||||
.auto_scroll(true),
|
||||
Direction::Horizontal => scrollable(
|
||||
row![
|
||||
scroll_to_end_button(),
|
||||
|
|
@ -236,7 +237,8 @@ impl ScrollableDemo {
|
|||
.width(Fill)
|
||||
.height(Fill)
|
||||
.id(SCROLLABLE)
|
||||
.on_scroll(Message::Scrolled),
|
||||
.on_scroll(Message::Scrolled)
|
||||
.auto_scroll(true),
|
||||
Direction::Multi => scrollable(
|
||||
//horizontal content
|
||||
row![
|
||||
|
|
@ -283,7 +285,8 @@ impl ScrollableDemo {
|
|||
.width(Fill)
|
||||
.height(Fill)
|
||||
.id(SCROLLABLE)
|
||||
.on_scroll(Message::Scrolled),
|
||||
.on_scroll(Message::Scrolled)
|
||||
.auto_scroll(true),
|
||||
});
|
||||
|
||||
let progress_bars: Element<Message> = match self.scrollable_direction {
|
||||
|
|
|
|||
|
|
@ -131,7 +131,8 @@ impl Styling {
|
|||
"You did it!"
|
||||
])
|
||||
.width(Fill)
|
||||
.height(Fill);
|
||||
.height(Fill)
|
||||
.auto_scroll(true);
|
||||
|
||||
let check = checkbox(self.checkbox_value)
|
||||
.label("Check me!")
|
||||
|
|
|
|||
|
|
@ -174,7 +174,8 @@ impl Tour {
|
|||
} else {
|
||||
content
|
||||
}))
|
||||
.spacing(10);
|
||||
.spacing(10)
|
||||
.auto_scroll(true);
|
||||
|
||||
center_y(scrollable).padding(10).into()
|
||||
}
|
||||
|
|
@ -626,7 +627,7 @@ pub enum Layout {
|
|||
impl Default for Tour {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
screen: Screen::Welcome,
|
||||
screen: Screen::Scrollable,
|
||||
slider: 50,
|
||||
layout: Layout::Row,
|
||||
spacing: 20,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue