Rename Renderer::Primitive to Renderer::Output

This commit is contained in:
Héctor Ramón Jiménez 2019-10-11 22:15:39 +02:00
parent 650d020fde
commit 8846a239cf
25 changed files with 48 additions and 48 deletions

View file

@ -100,8 +100,8 @@ impl Renderer {
fn draw(
&mut self,
target: &mut Target,
primitive: &Primitive,
target: &mut Target,
) -> MouseCursor {
log::debug!("Drawing");
@ -154,6 +154,7 @@ impl Renderer {
MouseCursor::OutOfBounds
}
fn draw_primitive(&mut self, primitive: &Primitive) {
match primitive {
Primitive::None => {}
@ -243,7 +244,7 @@ impl Renderer {
impl iced_native::Renderer for Renderer {
// TODO: Add `MouseCursor` here (?)
type Primitive = Primitive;
type Output = Primitive;
}
impl Windowed for Renderer {
@ -259,10 +260,10 @@ impl Windowed for Renderer {
fn draw(
&mut self,
output: &Self::Output,
target: &mut Target,
primitive: &Primitive,
) -> MouseCursor {
self.draw(target, primitive)
self.draw(output, target)
}
}
@ -273,7 +274,7 @@ impl Debugger for Renderer {
layout: Layout<'_>,
cursor_position: Point,
_color: Color,
) -> Self::Primitive {
) -> Self::Output {
// TODO: Include a bordered box to display layout bounds
widget.draw(self, layout, cursor_position)
}

View file

@ -21,7 +21,7 @@ impl button::Renderer for Renderer {
button: &Button<Message, Self>,
layout: Layout<'_>,
cursor_position: Point,
) -> Self::Primitive {
) -> Self::Output {
let bounds = layout.bounds();
Primitive::Group {

View file

@ -11,7 +11,7 @@ impl checkbox::Renderer for Renderer {
_checkbox: &Checkbox<Message>,
_layout: Layout<'_>,
_cursor_position: Point,
) -> Self::Primitive {
) -> Self::Output {
// TODO
Primitive::None
}

View file

@ -7,7 +7,7 @@ impl column::Renderer for Renderer {
column: &Column<'_, Message, Self>,
layout: Layout<'_>,
cursor_position: Point,
) -> Self::Primitive {
) -> Self::Output {
Primitive::Group {
primitives: column
.children

View file

@ -10,7 +10,7 @@ impl image::Renderer<&str> for Renderer {
&mut self,
_image: &Image<&str>,
_layout: Layout<'_>,
) -> Self::Primitive {
) -> Self::Output {
Primitive::None
}
}

View file

@ -11,7 +11,7 @@ impl radio::Renderer for Renderer {
_radio: &Radio<Message>,
_layout: Layout<'_>,
_cursor_position: Point,
) -> Self::Primitive {
) -> Self::Output {
Primitive::None
}
}

View file

@ -7,7 +7,7 @@ impl row::Renderer for Renderer {
row: &Row<'_, Message, Self>,
layout: Layout<'_>,
cursor_position: Point,
) -> Self::Primitive {
) -> Self::Output {
Primitive::Group {
primitives: row
.children

View file

@ -11,7 +11,7 @@ impl slider::Renderer for Renderer {
_slider: &Slider<Message>,
_layout: Layout<'_>,
_cursor_position: Point,
) -> Self::Primitive {
) -> Self::Output {
Primitive::None
}
}

View file

@ -67,7 +67,7 @@ impl text::Renderer for Renderer {
})
}
fn draw(&mut self, text: &Text, layout: Layout<'_>) -> Self::Primitive {
fn draw(&mut self, text: &Text, layout: Layout<'_>) -> Self::Output {
Primitive::Text {
content: text.content.clone(),
size: f32::from(text.size.unwrap_or(20)),