mirror of
https://github.com/emilk/egui.git
synced 2026-08-29 04:40:03 -04:00
Fixes
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
use std::any::TypeId;
|
use core::any::TypeId;
|
||||||
|
|
||||||
use crate::widget_style::StyleArgs;
|
use crate::widget_style::StyleArgs;
|
||||||
|
|
||||||
|
|||||||
@@ -86,6 +86,11 @@ impl Themes {
|
|||||||
pub fn get<S: WidgetStyle + 'static>(&self) -> ThemeWrap<S> {
|
pub fn get<S: WidgetStyle + 'static>(&self) -> ThemeWrap<S> {
|
||||||
let v = self.themes.get_temp::<ThemeWrap<S>>(Id::NULL);
|
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>()
|
||||||
|
)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
self.classes.iter().for_each(|class| {
|
self.classes.iter().for_each(|class| {
|
||||||
let _ = f.write_str(class.as_str());
|
let _ = f.write_str(class.as_str());
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ mod classes;
|
|||||||
|
|
||||||
pub use self::classes::{ClassName, Classes, HasClasses, ROOT_CLASS, SELECTED_CLASS};
|
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};
|
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
|
/// 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
|
/// General text style
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:05527c073b1ee2f6a15052a9097d1ad515331ff32d572cf510086f9ebb7a7bbc
|
oid sha256:391d5664dbb4925bb5deb765482da613795ca25eda099b3f29df3b4faf00eb01
|
||||||
size 27253
|
size 28657
|
||||||
|
|||||||
Reference in New Issue
Block a user