mirror of
https://github.com/extrawurst/gitui.git
synced 2024-11-23 03:32:30 +03:00
better default for single line textinput size (#2070)
This commit is contained in:
parent
286283d3ed
commit
e2590f79bd
@ -621,19 +621,21 @@ impl DrawableComponent for TextInputComponent {
|
|||||||
if let Some(ta) = &self.textarea {
|
if let Some(ta) = &self.textarea {
|
||||||
let area = if self.embed {
|
let area = if self.embed {
|
||||||
rect
|
rect
|
||||||
|
} else if self.input_type == InputType::Multiline {
|
||||||
|
let area = ui::centered_rect(60, 20, f.size());
|
||||||
|
ui::rect_inside(
|
||||||
|
Size::new(10, 3),
|
||||||
|
f.size().into(),
|
||||||
|
area,
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
match self.input_type {
|
let area = ui::centered_rect(60, 1, f.size());
|
||||||
InputType::Multiline => {
|
|
||||||
let area =
|
ui::rect_inside(
|
||||||
ui::centered_rect(60, 20, f.size());
|
Size::new(10, 3),
|
||||||
ui::rect_inside(
|
Size::new(f.size().width, 3),
|
||||||
Size::new(10, 3),
|
area,
|
||||||
f.size().into(),
|
)
|
||||||
area,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
_ => ui::centered_rect_absolute(32, 3, f.size()),
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
f.render_widget(Clear, area);
|
f.render_widget(Clear, area);
|
||||||
|
Loading…
Reference in New Issue
Block a user