Add Style variant support to application::StyleSheet

This commit is contained in:
Héctor Ramón Jiménez 2022-07-08 20:07:33 +02:00
parent fa55dff61d
commit bb07d017e8
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
11 changed files with 148 additions and 43 deletions

View file

@ -1,7 +1,13 @@
use iced_core::Color;
pub trait StyleSheet {
fn background_color(&self) -> Color;
type Style: Default + Copy;
fn text_color(&self) -> Color;
fn appearance(&self, style: Self::Style) -> Appearance;
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct Appearance {
pub background_color: Color,
pub text_color: Color,
}