1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-29 04:40:03 -04:00
This commit is contained in:
Lucas Meurer
2026-08-21 11:53:33 +02:00
parent eee5bdfd24
commit a7f5fb35b3
5 changed files with 12 additions and 7 deletions

View File

@@ -1,4 +1,4 @@
use std::any::TypeId;
use core::any::TypeId;
use crate::widget_style::StyleArgs;

View File

@@ -86,6 +86,11 @@ impl Themes {
pub fn get<S: WidgetStyle + 'static>(&self) -> ThemeWrap<S> {
let v = self.themes.get_temp::<ThemeWrap<S>>(Id::NULL);
v.unwrap_or_else(|| panic!("A style should be set for {:?}", std::any::type_name::<S>()))
v.unwrap_or_else(|| {
panic!(
"A style should be set for {:?}",
core::any::type_name::<S>()
)
})
}
}

View File

@@ -42,7 +42,7 @@ impl HasClasses for Classes {
}
}
impl std::fmt::Display for Classes {
impl core::fmt::Display for Classes {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
self.classes.iter().for_each(|class| {
let _ = f.write_str(class.as_str());

View File

@@ -6,7 +6,7 @@ mod classes;
pub use self::classes::{ClassName, Classes, HasClasses, ROOT_CLASS, SELECTED_CLASS};
use std::fmt::Debug;
use core::fmt::Debug;
use epaint::{Color32, FontId, Stroke, text::TextWrapMode};
@@ -16,7 +16,7 @@ use crate::{
};
/// Each dedicated style must implement this trait to be used in the theme plugin system
pub trait WidgetStyle: Debug + Clone + Send + Sync + std::any::Any + 'static {}
pub trait WidgetStyle: Debug + Clone + Send + Sync + core::any::Any + 'static {}
/// General text style
#[derive(Debug, Clone)]

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:05527c073b1ee2f6a15052a9097d1ad515331ff32d572cf510086f9ebb7a7bbc
size 27253
oid sha256:391d5664dbb4925bb5deb765482da613795ca25eda099b3f29df3b4faf00eb01
size 28657