Move Defaults from iced_graphics to iced_native
This commit is contained in:
parent
54a9a232f8
commit
edea093350
39 changed files with 166 additions and 192 deletions
|
|
@ -34,11 +34,6 @@ use crate::{Background, Color, Element, Rectangle, Vector};
|
|||
/// A component that can take the state of a user interface and produce an
|
||||
/// output for its users.
|
||||
pub trait Renderer: Sized {
|
||||
/// The default styling attributes of the [`Renderer`].
|
||||
///
|
||||
/// This type can be leveraged to implement style inheritance.
|
||||
type Defaults: Default;
|
||||
|
||||
/// Lays out the elements of a user interface.
|
||||
///
|
||||
/// You should override this if you need to perform any operations before or
|
||||
|
|
@ -71,3 +66,18 @@ pub struct Quad {
|
|||
pub border_width: f32,
|
||||
pub border_color: Color,
|
||||
}
|
||||
|
||||
/// The styling attributes of a [`Renderer`].
|
||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||
pub struct Style {
|
||||
/// The text color
|
||||
pub text_color: Color,
|
||||
}
|
||||
|
||||
impl Default for Style {
|
||||
fn default() -> Self {
|
||||
Style {
|
||||
text_color: Color::BLACK,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue