Remove trait-specific draw logic in iced_native

This commit is contained in:
Héctor Ramón Jiménez 2021-10-14 16:07:22 +07:00
parent 3aae45c191
commit 03b3493138
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
71 changed files with 641 additions and 3126 deletions

View file

@ -97,13 +97,8 @@ where
layout: Layout<'_>,
_cursor_position: Point,
_viewport: &Rectangle,
) -> Renderer::Output {
renderer.draw(
layout.bounds(),
self.range.clone(),
self.value,
&self.style,
)
) {
// TODO
}
fn hash_layout(&self, state: &mut Hasher) {
@ -127,22 +122,6 @@ pub trait Renderer: crate::Renderer {
/// The default height of a [`ProgressBar`].
const DEFAULT_HEIGHT: u16;
/// Draws a [`ProgressBar`].
///
/// It receives:
/// * the bounds of the [`ProgressBar`]
/// * the range of values of the [`ProgressBar`]
/// * the current value of the [`ProgressBar`]
/// * maybe a specific background of the [`ProgressBar`]
/// * maybe a specific active color of the [`ProgressBar`]
fn draw(
&self,
bounds: Rectangle,
range: RangeInclusive<f32>,
value: f32,
style: &Self::Style,
) -> Self::Output;
}
impl<'a, Message, Renderer> From<ProgressBar<Renderer>>