small QOL
This commit is contained in:
@@ -40,12 +40,12 @@ impl<State, O, H: WidgetOption<State>> TextBuilder<State, O, H> {
|
||||
self.attrs.wrap = wrap;
|
||||
self
|
||||
}
|
||||
pub fn editable(self, single_line: bool) -> TextBuilder<State, TextEditOutput, H> {
|
||||
pub fn editable(self, mode: EditMode) -> TextBuilder<State, TextEditOutput, H> {
|
||||
TextBuilder {
|
||||
content: self.content,
|
||||
attrs: self.attrs,
|
||||
hint: self.hint,
|
||||
output: TextEditOutput { single_line },
|
||||
output: TextEditOutput { mode },
|
||||
state: PhantomData,
|
||||
}
|
||||
}
|
||||
@@ -100,7 +100,7 @@ impl<State: 'static> TextBuilderOutput<State> for TextOutput {
|
||||
}
|
||||
|
||||
pub struct TextEditOutput {
|
||||
single_line: bool,
|
||||
mode: EditMode,
|
||||
}
|
||||
impl<State: 'static> TextBuilderOutput<State> for TextEditOutput {
|
||||
type Output = TextEdit<State>;
|
||||
@@ -115,7 +115,7 @@ impl<State: 'static> TextBuilderOutput<State> for TextEditOutput {
|
||||
));
|
||||
let mut text = TextEdit::new(
|
||||
TextView::new(buf, builder.attrs, builder.hint.get(ui)),
|
||||
builder.output.single_line,
|
||||
builder.output.mode,
|
||||
);
|
||||
let font_system = &mut ui.text.font_system;
|
||||
text.buf
|
||||
|
||||
Reference in New Issue
Block a user