maycoon_theme/theme/
mod.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use peniko::Color;

use crate::globals::Globals;
use crate::id::WidgetId;
use crate::style::{DefaultStyles, Style};

/// The Celeste Theme.
pub mod celeste;

/// Base trait for all themes.
pub trait Theme {
    /// Return the Style of the given widget using its ID.
    /// Returns [None] if the theme does not have styles for the given widget.
    /// In that case, you should use [Theme::defaults] to get widget style defaults.
    fn of(&self, id: WidgetId) -> Option<Style>;
    /// Get the default widget styles.
    fn defaults(&self) -> DefaultStyles;
    /// Get the background color of the window.
    fn window_background(&self) -> Color;
    /// Get global style values.
    fn globals(&self) -> &Globals;
    /// Get mutable global style values.
    fn globals_mut(&mut self) -> &mut Globals;
}