➖ Integrate "SmartDefault" as "AutoDefault" macro
This commit is contained in:
parent
cb38145bf5
commit
9e4f593dbd
51 changed files with 387 additions and 103 deletions
|
|
@ -1,11 +1,11 @@
|
|||
use crate::core::action::ActionTrait;
|
||||
use crate::SmartDefault;
|
||||
use crate::AutoDefault;
|
||||
|
||||
use std::sync::{Arc, RwLock};
|
||||
|
||||
pub type Action = Box<dyn ActionTrait>;
|
||||
|
||||
#[derive(SmartDefault)]
|
||||
#[derive(AutoDefault)]
|
||||
pub struct ActionsList(Arc<RwLock<Vec<Action>>>);
|
||||
|
||||
impl ActionsList {
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
use crate::core::component::Context;
|
||||
use crate::SmartDefault;
|
||||
use crate::AutoDefault;
|
||||
|
||||
pub type FnIsRenderable = fn(cx: &Context) -> bool;
|
||||
|
||||
#[derive(SmartDefault)]
|
||||
#[derive(AutoDefault)]
|
||||
pub struct Renderable {
|
||||
#[default(_code = "render_always")]
|
||||
pub check: FnIsRenderable,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use crate::core::component::{AnyComponents, ArcAnyComponent, ArcAnyOp};
|
||||
use crate::core::theme::ThemeRef;
|
||||
use crate::{LazyStatic, SmartDefault, TypeId};
|
||||
use crate::{AutoDefault, LazyStatic, TypeId};
|
||||
|
||||
use std::collections::HashMap;
|
||||
use std::sync::RwLock;
|
||||
|
|
@ -11,7 +11,7 @@ static THEME_REGIONS: LazyStatic<RwLock<HashMap<TypeId, ComponentsInRegions>>> =
|
|||
static COMMON_REGIONS: LazyStatic<RwLock<ComponentsInRegions>> =
|
||||
LazyStatic::new(|| RwLock::new(ComponentsInRegions::default()));
|
||||
|
||||
#[derive(SmartDefault)]
|
||||
#[derive(AutoDefault)]
|
||||
pub struct ComponentsInRegions(HashMap<&'static str, AnyComponents>);
|
||||
|
||||
impl ComponentsInRegions {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue