maycoon_theme/theme/
mod.rs

1use peniko::Color;
2
3use crate::globals::Globals;
4use crate::id::WidgetId;
5use crate::style::{DefaultStyles, Style};
6
7/// The Celeste Theme.
8pub mod celeste;
9
10/// Base trait for all themes.
11pub trait Theme {
12    /// Return the [Style] of the given widget using its ID.
13    /// Returns [None] if the theme does not have styles for the given widget.
14    /// In that case, you should use [Theme::defaults] to get widget style defaults.
15    fn of(&self, id: WidgetId) -> Option<Style>;
16    /// Get the default widget styles.
17    fn defaults(&self) -> DefaultStyles;
18    /// Get the background color of the window.
19    fn window_background(&self) -> Color;
20    /// Get global style values.
21    fn globals(&self) -> &Globals;
22    /// Get mutable global style values.
23    fn globals_mut(&mut self) -> &mut Globals;
24}