scrollbar: Remove Scrollbar::uniform_scroll, use Scrollbar::vertical instead. (#1659)
## Break Change - Remove `Scrollbar::uniform_scroll`, use `Scrollbar::vertical` instead. ```diff - Scrollbar::uniform_scroll(&scroll_state, &scroll_handle) + Scrollbar::vertical(&scroll_state, &scroll_handle) ```
This commit is contained in:
parent
c523b3485b
commit
857f7973e3
3 changed files with 3 additions and 14 deletions
|
|
@ -550,7 +550,7 @@ where
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.when(scrollbar_visible, |this| {
|
.when(scrollbar_visible, |this| {
|
||||||
this.child(Scrollbar::uniform_scroll(&scroll_state, &scroll_handle))
|
this.child(Scrollbar::vertical(&scroll_state, &scroll_handle))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -359,14 +359,6 @@ impl Scrollbar {
|
||||||
Self::new(ScrollbarAxis::Vertical, state, scroll_handle)
|
Self::new(ScrollbarAxis::Vertical, state, scroll_handle)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create vertical scrollbar for uniform list.
|
|
||||||
pub fn uniform_scroll(
|
|
||||||
state: &ScrollbarState,
|
|
||||||
scroll_handle: &(impl ScrollHandleOffsetable + Clone + 'static),
|
|
||||||
) -> Self {
|
|
||||||
Self::new(ScrollbarAxis::Vertical, state, scroll_handle)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Set the scrollbar show mode [`ScrollbarShow`], if not set use the `cx.theme().scrollbar_show`.
|
/// Set the scrollbar show mode [`ScrollbarShow`], if not set use the `cx.theme().scrollbar_show`.
|
||||||
pub fn scrollbar_show(mut self, scrollbar_show: ScrollbarShow) -> Self {
|
pub fn scrollbar_show(mut self, scrollbar_show: ScrollbarShow) -> Self {
|
||||||
self.scrollbar_show = Some(scrollbar_show);
|
self.scrollbar_show = Some(scrollbar_show);
|
||||||
|
|
|
||||||
|
|
@ -1214,11 +1214,8 @@ where
|
||||||
.bottom_0()
|
.bottom_0()
|
||||||
.w(Scrollbar::width())
|
.w(Scrollbar::width())
|
||||||
.child(
|
.child(
|
||||||
Scrollbar::uniform_scroll(
|
Scrollbar::vertical(&self.vertical_scroll_state, &self.vertical_scroll_handle)
|
||||||
&self.vertical_scroll_state,
|
.max_fps(60),
|
||||||
&self.vertical_scroll_handle,
|
|
||||||
)
|
|
||||||
.max_fps(60),
|
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue