🚚 Rename alter_...(...) functions to set_...(...)
This commit is contained in:
parent
dfb34d2e36
commit
fea6c2f69e
42 changed files with 314 additions and 312 deletions
|
|
@ -46,74 +46,74 @@ impl Page {
|
|||
// Page BUILDER.
|
||||
|
||||
#[fn_builder]
|
||||
pub fn alter_title(&mut self, title: L10n) -> &mut Self {
|
||||
self.title.alter_value(title);
|
||||
pub fn set_title(&mut self, title: L10n) -> &mut Self {
|
||||
self.title.set_value(title);
|
||||
self
|
||||
}
|
||||
|
||||
#[fn_builder]
|
||||
pub fn alter_description(&mut self, description: L10n) -> &mut Self {
|
||||
self.description.alter_value(description);
|
||||
pub fn set_description(&mut self, description: L10n) -> &mut Self {
|
||||
self.description.set_value(description);
|
||||
self
|
||||
}
|
||||
|
||||
#[fn_builder]
|
||||
pub fn alter_metadata(&mut self, name: &'static str, content: &'static str) -> &mut Self {
|
||||
pub fn set_metadata(&mut self, name: &'static str, content: &'static str) -> &mut Self {
|
||||
self.metadata.push((name, content));
|
||||
self
|
||||
}
|
||||
|
||||
#[fn_builder]
|
||||
pub fn alter_property(&mut self, property: &'static str, content: &'static str) -> &mut Self {
|
||||
pub fn set_property(&mut self, property: &'static str, content: &'static str) -> &mut Self {
|
||||
self.metadata.push((property, content));
|
||||
self
|
||||
}
|
||||
|
||||
#[fn_builder]
|
||||
pub fn alter_favicon(&mut self, favicon: Option<Favicon>) -> &mut Self {
|
||||
pub fn set_favicon(&mut self, favicon: Option<Favicon>) -> &mut Self {
|
||||
self.favicon = favicon;
|
||||
self
|
||||
}
|
||||
|
||||
#[fn_builder]
|
||||
pub fn alter_assets(&mut self, op: AssetsOp) -> &mut Self {
|
||||
self.context.alter_assets(op);
|
||||
pub fn set_assets(&mut self, op: AssetsOp) -> &mut Self {
|
||||
self.context.set_assets(op);
|
||||
self
|
||||
}
|
||||
|
||||
#[fn_builder]
|
||||
pub fn alter_body_id(&mut self, id: impl Into<String>) -> &mut Self {
|
||||
self.body_id.alter_value(id);
|
||||
pub fn set_body_id(&mut self, id: impl Into<String>) -> &mut Self {
|
||||
self.body_id.set_value(id);
|
||||
self
|
||||
}
|
||||
|
||||
#[fn_builder]
|
||||
pub fn alter_body_classes(&mut self, op: ClassesOp, classes: impl Into<String>) -> &mut Self {
|
||||
self.body_classes.alter_value(op, classes);
|
||||
pub fn set_body_classes(&mut self, op: ClassesOp, classes: impl Into<String>) -> &mut Self {
|
||||
self.body_classes.set_value(op, classes);
|
||||
self
|
||||
}
|
||||
|
||||
#[fn_builder]
|
||||
pub fn alter_body_skip_to(&mut self, id: impl Into<String>) -> &mut Self {
|
||||
self.body_skip_to.alter_value(id);
|
||||
pub fn set_body_skip_to(&mut self, id: impl Into<String>) -> &mut Self {
|
||||
self.body_skip_to.set_value(id);
|
||||
self
|
||||
}
|
||||
|
||||
#[fn_builder]
|
||||
pub fn alter_layout(&mut self, layout: &'static str) -> &mut Self {
|
||||
self.context.alter_assets(AssetsOp::Layout(layout));
|
||||
pub fn set_layout(&mut self, layout: &'static str) -> &mut Self {
|
||||
self.context.set_assets(AssetsOp::Layout(layout));
|
||||
self
|
||||
}
|
||||
|
||||
#[fn_builder]
|
||||
pub fn alter_regions(&mut self, region: &'static str, op: AnyOp) -> &mut Self {
|
||||
self.context.alter_regions(region, op);
|
||||
pub fn set_regions(&mut self, region: &'static str, op: AnyOp) -> &mut Self {
|
||||
self.context.set_regions(region, op);
|
||||
self
|
||||
}
|
||||
|
||||
pub fn with_component(mut self, component: impl ComponentTrait) -> Self {
|
||||
self.context
|
||||
.alter_regions("content", AnyOp::Add(AnyComponent::with(component)));
|
||||
.set_regions("content", AnyOp::Add(AnyComponent::with(component)));
|
||||
self
|
||||
}
|
||||
|
||||
|
|
@ -123,7 +123,7 @@ impl Page {
|
|||
component: impl ComponentTrait,
|
||||
) -> Self {
|
||||
self.context
|
||||
.alter_regions(region, AnyOp::Add(AnyComponent::with(component)));
|
||||
.set_regions(region, AnyOp::Add(AnyComponent::with(component)));
|
||||
self
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue