Remove appearance from Handle

... and pass it directly to `Renderer::draw` instead.
This commit is contained in:
Héctor Ramón Jiménez 2022-12-06 04:34:00 +01:00
parent 314b0f7dc5
commit b205a66347
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
14 changed files with 112 additions and 75 deletions

View file

@ -2,20 +2,22 @@
use iced_core::Color;
/// The appearance of a svg.
/// The appearance of an SVG.
#[derive(Debug, Default, Clone, Copy)]
pub struct Appearance {
/// Changes the fill color
/// The [`Color`] filter of an SVG.
///
/// Useful for coloring a symbolic icon.
pub fill: Option<Color>,
///
/// `None` keeps the original color.
pub color: Option<Color>,
}
/// The stylesheet of a svg.
pub trait StyleSheet {
/// The supported style of the [`StyleSheet`].
type Style: Default + Copy;
type Style: Default;
/// Produces the [`Appearance`] of the svg.
fn appearance(&self, style: Self::Style) -> Appearance;
fn appearance(&self, style: &Self::Style) -> Appearance;
}