summaryrefslogtreecommitdiffstats
path: root/graphics/src/widget/scrollable.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--graphics/src/widget/scrollable.rs (renamed from wgpu/src/renderer/widget/scrollable.rs)23
1 files changed, 20 insertions, 3 deletions
diff --git a/wgpu/src/renderer/widget/scrollable.rs b/graphics/src/widget/scrollable.rs
index 8a400b82..b149db0a 100644
--- a/wgpu/src/renderer/widget/scrollable.rs
+++ b/graphics/src/widget/scrollable.rs
@@ -1,10 +1,27 @@
-use crate::{Primitive, Renderer};
-use iced_native::{mouse, scrollable, Background, Color, Rectangle, Vector};
+//! Navigate an endless amount of content with a scrollbar.
+use crate::{Backend, Primitive, Renderer};
+use iced_native::mouse;
+use iced_native::scrollable;
+use iced_native::{Background, Color, Rectangle, Vector};
+
+pub use iced_native::scrollable::State;
+pub use iced_style::scrollable::{Scrollbar, Scroller, StyleSheet};
+
+/// A widget that can vertically display an infinite amount of content
+/// with a scrollbar.
+///
+/// This is an alias of an `iced_native` scrollable with a default
+/// `Renderer`.
+pub type Scrollable<'a, Message, Backend> =
+ iced_native::Scrollable<'a, Message, Renderer<Backend>>;
const SCROLLBAR_WIDTH: u16 = 10;
const SCROLLBAR_MARGIN: u16 = 2;
-impl scrollable::Renderer for Renderer {
+impl<B> scrollable::Renderer for Renderer<B>
+where
+ B: Backend,
+{
type Style = Box<dyn iced_style::scrollable::StyleSheet>;
fn scrollbar(