From 2547239a50980ba7dace05405a88f5b680900191 Mon Sep 17 00:00:00 2001 From: doryan Date: Sat, 17 Aug 2024 21:38:24 +0400 Subject: [PATCH] feat(input): add oportunity for set up markup mode --- src/view/components/input.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/view/components/input.rs b/src/view/components/input.rs index 65cf843..81ee91c 100644 --- a/src/view/components/input.rs +++ b/src/view/components/input.rs @@ -15,6 +15,7 @@ macro_rules! build_for { .halign(self.align.horizontal) .valign(self.align.vertical) .set_margin(self.margins) + .use_markup(self.markup) .label(self.label) .build(); @@ -51,6 +52,7 @@ pub struct InputBuilder { align: Alignment, label: InputLabel, margins: MarginData, + markup: bool, } impl Product for Input { @@ -62,6 +64,7 @@ impl Product for Input { }, label: String::new(), margins: MarginData::EqualsMargin(5), + markup: false, } } @@ -91,6 +94,12 @@ impl InputBuilder { self } + pub fn markup(mut self, toggle: bool) -> Self { + self.markup = toggle; + + self + } + pub fn align(mut self, align: Alignment) -> Self { self.align = align;