Added an Icon widget to native.

This commit is contained in:
Malte Veerman 2019-12-06 19:37:56 +01:00
parent 8032428428
commit a88aae5e04
7 changed files with 138 additions and 6 deletions

View file

@ -1,6 +1,7 @@
mod button;
mod checkbox;
mod column;
mod icon;
mod image;
mod radio;
mod row;

View file

@ -0,0 +1,21 @@
use crate::{svg::Handle, Primitive, Renderer};
use iced_native::{
icon, MouseCursor, Rectangle,
};
use std::path::Path;
impl icon::Renderer for Renderer {
fn draw(
&mut self,
bounds: Rectangle,
path: &Path,
) -> Self::Output {
(
Primitive::Svg {
handle: Handle::from_path(path),
bounds,
},
MouseCursor::OutOfBounds,
)
}
}