Struct egui_theme::EguiTheme
source · [−]pub struct EguiTheme { /* private fields */ }Expand description
The EguiTheme is the serializable contents of the relevant font information. This is intended to only be used when reading and writing the Style and FontDefinition information to/from disk.
The FontData is stored directly into the theme as base64 encoded Strings.
Important
This should only be used during the Serialization/Deserialization process. Once the loading has completed, this should be extracted directly to an egui::Context as soon as it has been fully loaded.
Implementations
sourceimpl EguiTheme
impl EguiTheme
sourcepub fn new(style: Style, font_definitions: FontDefinitions) -> Self
pub fn new(style: Style, font_definitions: FontDefinitions) -> Self
Create a new style from the required information.
style the egui style information
font_definitions the current font definitions.
sourcepub fn extract(self) -> (Style, FontDefinitions)
pub fn extract(self) -> (Style, FontDefinitions)
Consumes the deserialized theme destructively to product the style/font
pub fn load_into_context(self, context: &mut Context)
Trait Implementations
sourceimpl<'de> Deserialize<'de> for EguiTheme
impl<'de> Deserialize<'de> for EguiTheme
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for EguiTheme
impl Send for EguiTheme
impl Sync for EguiTheme
impl Unpin for EguiTheme
impl UnwindSafe for EguiTheme
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more