From 350c750e16afca4275b7ffc086fbeb5904df7166 Mon Sep 17 00:00:00 2001 From: Manuel Cillero Date: Sun, 13 Aug 2023 10:57:20 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20Apply=20last=20component=20manag?= =?UTF-8?q?ement=20changes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pagetop-minimal/src/component/container.rs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/pagetop-minimal/src/component/container.rs b/pagetop-minimal/src/component/container.rs index 67164b88..b3c79f4a 100644 --- a/pagetop-minimal/src/component/container.rs +++ b/pagetop-minimal/src/component/container.rs @@ -23,7 +23,7 @@ pub struct Container { classes : Classes, inner_classes : Classes, container_type: ContainerType, - content : PackComponents, + stuff : PackComponents, template : String, } @@ -131,7 +131,7 @@ impl Container { } #[fn_builder] - pub fn alter_renderable(&mut self, check: IsRenderable) -> &mut Self { + pub fn alter_renderable(&mut self, check: FnIsRenderable) -> &mut Self { self.renderable.check = check; self } @@ -155,12 +155,17 @@ impl Container { } pub fn with_component(mut self, component: impl ComponentTrait) -> Self { - self.content.alter(PackOp::Add, ComponentRef::to(component)); + self.stuff.alter(PackOp::Add, ComponentArc::new(component)); + self + } + + pub fn with_component_arc(mut self, arc: ComponentArc) -> Self { + self.stuff.alter(PackOp::Add, arc); self } pub fn alter_components(&mut self, op: PackOp, component: impl ComponentTrait) -> &mut Self { - self.content.alter(op, ComponentRef::to(component)); + self.stuff.alter(op, ComponentArc::new(component)); self } @@ -185,7 +190,7 @@ impl Container { } pub fn components(&self) -> &PackComponents { - &self.content + &self.stuff } pub fn template(&self) -> &str {