best ever, working as intended

This commit is contained in:
filipriec
2025-04-17 21:07:07 +02:00
parent 8f74febff1
commit e723198b72

View File

@@ -38,11 +38,9 @@ pub fn render_add_table(
); );
// --- Main Page Block --- // --- Main Page Block ---
// Use a centered title for wide, left for narrow? Or keep consistent?
// Let's keep it consistent for now (centered).
let main_block = Block::default() let main_block = Block::default()
.title(" Add New Table ") .title(" Add New Table ")
.title_alignment(Alignment::Center) // Centered title .title_alignment(Alignment::Center)
.borders(Borders::ALL) .borders(Borders::ALL)
.border_type(BorderType::Rounded) .border_type(BorderType::Rounded)
.border_style(Style::default().fg(theme.border)) .border_style(Style::default().fg(theme.border))
@@ -65,7 +63,7 @@ pub fn render_add_table(
let main_chunks = Layout::default() let main_chunks = Layout::default()
.direction(Direction::Vertical) .direction(Direction::Vertical)
.constraints([ .constraints([
Constraint::Length(2), // Top Info (Profile/Table Name) Constraint::Length(3), // Top Info (Profile/Table Name) - Increased to 3 lines
Constraint::Min(10), // Middle Area (Columns | Right Pane) Constraint::Min(10), // Middle Area (Columns | Right Pane)
Constraint::Length(3), // Bottom Buttons Constraint::Length(3), // Bottom Buttons
]) ])
@@ -124,7 +122,7 @@ pub fn render_add_table(
)), )),
]) ])
.block( .block(
Block::default() // Add bottom border for separation Block::default()
.borders(Borders::BOTTOM) .borders(Borders::BOTTOM)
.border_style(Style::default().fg(theme.secondary)), .border_style(Style::default().fg(theme.secondary)),
); );
@@ -178,7 +176,7 @@ pub fn render_add_table(
f.render_widget(profile_text, top_info_chunks[0]); f.render_widget(profile_text, top_info_chunks[0]);
let table_name_text = Paragraph::new(Span::styled( let table_name_text = Paragraph::new(Span::styled(
format!("table name: {}", add_table_state.table_name), format!("table: {}", add_table_state.table_name),
theme.fg, theme.fg,
)) ))
.alignment(Alignment::Left); .alignment(Alignment::Left);
@@ -422,4 +420,3 @@ pub fn render_add_table(
); );
f.render_widget(cancel_button, bottom_button_chunks[1]); f.render_widget(cancel_button, bottom_button_chunks[1]);
} }