card widget

This commit is contained in:
Ashley Wulber 2023-07-17 11:44:57 -04:00 committed by Ashley Wulber
parent 56d24b2372
commit f17d52f37f
4 changed files with 110 additions and 1 deletions

1
src/widget/card/mod.rs Normal file
View file

@ -0,0 +1 @@
pub mod style;

23
src/widget/card/style.rs Normal file
View file

@ -0,0 +1,23 @@
use iced_core::{Background, Color};
/// Appearance of the cards.
#[derive(Clone, Copy)]
pub struct Appearance {
pub card_1: Background,
pub card_2: Background,
}
impl Default for Appearance {
fn default() -> Self {
Self {
card_1: Background::Color(Color::WHITE),
card_2: Background::Color(Color::WHITE),
}
}
}
/// Defines the [`Appearance`] of a cards.
pub trait StyleSheet {
/// The default [`Appearance`] of the cards.
fn default(&self) -> Appearance;
}

View file

@ -8,6 +8,9 @@ pub mod aspect_ratio;
mod button;
pub use button::*;
pub mod card;
pub use card::*;
pub mod flex_row;
pub use flex_row::{flex_row, FlexRow};