wip: refactor
This commit is contained in:
@@ -178,6 +178,7 @@ pub struct TextInput {
|
||||
pub(super) appearance: bool,
|
||||
pub(super) cleanable: bool,
|
||||
pub(super) size: Size,
|
||||
pub(super) text_size: Size,
|
||||
pub(super) rows: usize,
|
||||
pattern: Option<regex::Regex>,
|
||||
validate: Validate,
|
||||
@@ -215,6 +216,7 @@ impl TextInput {
|
||||
prefix: None,
|
||||
suffix: None,
|
||||
size: Size::Medium,
|
||||
text_size: Size::Medium,
|
||||
pattern: None,
|
||||
validate: None,
|
||||
rows: 2,
|
||||
@@ -333,6 +335,12 @@ impl TextInput {
|
||||
cx.notify();
|
||||
}
|
||||
|
||||
/// Set the Input size
|
||||
pub fn text_size(mut self, size: Size) -> Self {
|
||||
self.text_size = size;
|
||||
self
|
||||
}
|
||||
|
||||
/// Set the appearance of the input field.
|
||||
pub fn appearance(mut self, appearance: bool) -> Self {
|
||||
self.appearance = appearance;
|
||||
@@ -1204,6 +1212,7 @@ impl Render for TextInput {
|
||||
.line_height(LINE_HEIGHT)
|
||||
.input_py(self.size)
|
||||
.input_h(self.size)
|
||||
.input_text_size(self.text_size)
|
||||
.cursor_text()
|
||||
.when(self.multi_line, |this| {
|
||||
this.on_action(cx.listener(Self::up))
|
||||
|
||||
Reference in New Issue
Block a user