feat(input): add generic type for other input components
This commit is contained in:
parent
06439585eb
commit
d3327a7c36
|
@ -41,9 +41,9 @@ macro_rules! build_for {
|
|||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct Input {
|
||||
pub struct Input<I> {
|
||||
component: Box,
|
||||
input: TextView,
|
||||
input: I,
|
||||
input_label: Label,
|
||||
input_frame: Frame,
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ pub struct InputBuilder {
|
|||
margins: MarginData,
|
||||
}
|
||||
|
||||
impl Product<InputBuilder, Box> for Input {
|
||||
impl<I> Product<InputBuilder, Box> for Input<I> {
|
||||
fn builder() -> InputBuilder {
|
||||
InputBuilder {
|
||||
align: Alignment {
|
||||
|
@ -71,13 +71,13 @@ impl Product<InputBuilder, Box> for Input {
|
|||
}
|
||||
}
|
||||
|
||||
impl Input {
|
||||
pub fn get_input(&self) -> &TextView {
|
||||
&self.input
|
||||
impl<I> Input<I> {
|
||||
}
|
||||
|
||||
pub fn get_frame(&self) -> &Frame {
|
||||
&self.input_frame
|
||||
pub fn get_input(&self) -> &I {
|
||||
&self.input
|
||||
}
|
||||
|
||||
pub fn get_label(&self) -> &Label {
|
||||
|
|
Loading…
Reference in New Issue