Implement styling for Slider

This commit is contained in:
Héctor Ramón Jiménez 2020-01-07 00:28:08 +01:00
parent d0dc7cebf9
commit b329003c8f
9 changed files with 266 additions and 47 deletions

View file

@ -1,7 +1,7 @@
use crate::{
button, checkbox, column, radio, row, scrollable, text, text_input, Color,
Element, Font, HorizontalAlignment, Layout, Point, Rectangle, Renderer,
Size, VerticalAlignment,
button, checkbox, column, radio, row, scrollable, slider, text, text_input,
Color, Element, Font, HorizontalAlignment, Layout, Point, Rectangle,
Renderer, Size, VerticalAlignment,
};
/// A renderer that does nothing.
@ -180,3 +180,22 @@ impl checkbox::Renderer for Null {
) {
}
}
impl slider::Renderer for Null {
type Style = ();
fn height(&self) -> u32 {
30
}
fn draw(
&mut self,
_bounds: Rectangle,
_cursor_position: Point,
_range: std::ops::RangeInclusive<f32>,
_value: f32,
_is_dragging: bool,
_style_sheet: &Self::Style,
) -> Self::Output {
}
}