egui 0.37.0

An easy-to-use immediate mode GUI that runs on both web and native
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use core::any::TypeId;

use crate::widget_style::StyleArgs;

/// A Theme plugin that implement a style computation for a defined `WidgetStyle`
pub trait StyleProvider<S> {
    /// The style according to the classes and state of the widget
    fn style(&mut self, modifiers: &StyleArgs<'_>) -> S;

    /// Used to tell different themes apart
    fn type_id(&self) -> TypeId
    where
        Self: 'static,
    {
        TypeId::of::<Self>()
    }
}