more fixes
This commit is contained in:
@@ -43,21 +43,18 @@ pub fn render_form(
|
||||
.border_style(Style::default().fg(theme.accent))
|
||||
.style(Style::default().bg(theme.bg));
|
||||
|
||||
// Center the input box vertically
|
||||
let vertical_center = Layout::default()
|
||||
.direction(Direction::Vertical)
|
||||
.constraints([
|
||||
Constraint::Min(1),
|
||||
Constraint::Length(fields.len() as u16 + 2), // +2 for borders
|
||||
Constraint::Min(1),
|
||||
])
|
||||
.split(columns[1]);
|
||||
// Place the input container at the top
|
||||
let input_container_area = Rect {
|
||||
x: columns[1].x,
|
||||
y: columns[1].y,
|
||||
width: columns[1].width,
|
||||
height: fields.len() as u16 + 2, // +2 for borders
|
||||
};
|
||||
|
||||
// Render the input container
|
||||
f.render_widget(&input_container, vertical_center[1]);
|
||||
f.render_widget(&input_container, input_container_area);
|
||||
|
||||
// Input area inside borders
|
||||
let input_area = input_container.inner(vertical_center[1]);
|
||||
let input_area = input_container.inner(input_container_area);
|
||||
let input_rows = Layout::default()
|
||||
.direction(Direction::Vertical)
|
||||
.constraints(vec![Constraint::Length(1); fields.len()])
|
||||
@@ -71,7 +68,7 @@ pub fn render_form(
|
||||
)));
|
||||
f.render_widget(label, Rect {
|
||||
x: columns[0].x,
|
||||
y: vertical_center[1].y + 1 + i as u16, // Align with input rows
|
||||
y: input_container_area.y + 1 + i as u16, // Align with input rows
|
||||
width: columns[0].width,
|
||||
height: 1,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user