feat(input): add oportunity for set up markup mode

This commit is contained in:
doryan 2024-08-17 21:38:24 +04:00
parent 9455412170
commit 2547239a50

View File

@ -15,6 +15,7 @@ macro_rules! build_for {
.halign(self.align.horizontal) .halign(self.align.horizontal)
.valign(self.align.vertical) .valign(self.align.vertical)
.set_margin(self.margins) .set_margin(self.margins)
.use_markup(self.markup)
.label(self.label) .label(self.label)
.build(); .build();
@ -51,6 +52,7 @@ pub struct InputBuilder {
align: Alignment, align: Alignment,
label: InputLabel, label: InputLabel,
margins: MarginData, margins: MarginData,
markup: bool,
} }
impl<I> Product<InputBuilder, Box> for Input<I> { impl<I> Product<InputBuilder, Box> for Input<I> {
@ -62,6 +64,7 @@ impl<I> Product<InputBuilder, Box> for Input<I> {
}, },
label: String::new(), label: String::new(),
margins: MarginData::EqualsMargin(5), margins: MarginData::EqualsMargin(5),
markup: false,
} }
} }
@ -91,6 +94,12 @@ impl InputBuilder {
self self
} }
pub fn markup(mut self, toggle: bool) -> Self {
self.markup = toggle;
self
}
pub fn align(mut self, align: Alignment) -> Self { pub fn align(mut self, align: Alignment) -> Self {
self.align = align; self.align = align;