ui imporvements
This commit is contained in:
@@ -89,8 +89,8 @@ pub fn render_add_table(
|
|||||||
return; // IMPORTANT: Stop rendering here for fullscreen mode
|
return; // IMPORTANT: Stop rendering here for fullscreen mode
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- Fullscreen Indexes Table Check (Narrow Screens Only) ---
|
// --- Fullscreen Indexes Table Check ---
|
||||||
if area.width < NARROW_LAYOUT_THRESHOLD && add_table_state.current_focus == AddTableFocus::InsideIndexesTable {
|
if add_table_state.current_focus == AddTableFocus::InsideIndexesTable { // Remove width check
|
||||||
// Render ONLY the indexes table taking the full inner area
|
// Render ONLY the indexes table taking the full inner area
|
||||||
let indexes_border_style = Style::default().fg(theme.highlight); // Always highlighted when fullscreen
|
let indexes_border_style = Style::default().fg(theme.highlight); // Always highlighted when fullscreen
|
||||||
let index_rows: Vec<Row<'_>> = add_table_state
|
let index_rows: Vec<Row<'_>> = add_table_state
|
||||||
@@ -124,8 +124,8 @@ pub fn render_add_table(
|
|||||||
return; // IMPORTANT: Stop rendering here for fullscreen mode
|
return; // IMPORTANT: Stop rendering here for fullscreen mode
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- Fullscreen Links Table Check (Narrow Screens Only) ---
|
// --- Fullscreen Links Table Check ---
|
||||||
if area.width < NARROW_LAYOUT_THRESHOLD && add_table_state.current_focus == AddTableFocus::InsideLinksTable {
|
if add_table_state.current_focus == AddTableFocus::InsideLinksTable {
|
||||||
// Render ONLY the links table taking the full inner area
|
// Render ONLY the links table taking the full inner area
|
||||||
let links_border_style = Style::default().fg(theme.highlight); // Always highlighted when fullscreen
|
let links_border_style = Style::default().fg(theme.highlight); // Always highlighted when fullscreen
|
||||||
let link_rows: Vec<Row<'_>> = add_table_state
|
let link_rows: Vec<Row<'_>> = add_table_state
|
||||||
@@ -133,17 +133,18 @@ pub fn render_add_table(
|
|||||||
.iter()
|
.iter()
|
||||||
.map(|link_def| {
|
.map(|link_def| {
|
||||||
Row::new(vec![
|
Row::new(vec![
|
||||||
Cell::from(link_def.linked_table_name.clone()),
|
Cell::from(if link_def.selected { "[*]" } else { "[ ]" }), // Selection first
|
||||||
Cell::from(if link_def.selected { "[*]" } else { "[ ]" }),
|
Cell::from(link_def.linked_table_name.clone()), // Table name second
|
||||||
])
|
])
|
||||||
.style(Style::default().fg(theme.fg))
|
.style(Style::default().fg(theme.fg))
|
||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
let link_header_cells = ["Available Table", "Selected"]
|
let link_header_cells = ["Sel", "Available Table"]
|
||||||
|
|
||||||
.iter()
|
.iter()
|
||||||
.map(|h| Cell::from(*h).style(Style::default().fg(theme.accent)));
|
.map(|h| Cell::from(*h).style(Style::default().fg(theme.accent)));
|
||||||
let link_header = Row::new(link_header_cells).height(1).bottom_margin(1);
|
let link_header = Row::new(link_header_cells).height(1).bottom_margin(1);
|
||||||
let links_table = Table::new(link_rows, [Constraint::Percentage(95), Constraint::Length(5)])
|
let links_table = Table::new(link_rows, [Constraint::Length(5), Constraint::Percentage(95)])
|
||||||
.header(link_header)
|
.header(link_header)
|
||||||
.block(
|
.block(
|
||||||
Block::default()
|
Block::default()
|
||||||
@@ -460,18 +461,18 @@ pub fn render_add_table(
|
|||||||
.iter()
|
.iter()
|
||||||
.map(|link_def| {
|
.map(|link_def| {
|
||||||
Row::new(vec![
|
Row::new(vec![
|
||||||
Cell::from(link_def.linked_table_name.clone()),
|
|
||||||
Cell::from(if link_def.selected { "[*]" } else { "[ ]" }),
|
Cell::from(if link_def.selected { "[*]" } else { "[ ]" }),
|
||||||
|
Cell::from(link_def.linked_table_name.clone()),
|
||||||
])
|
])
|
||||||
.style(Style::default().fg(theme.fg))
|
.style(Style::default().fg(theme.fg))
|
||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
let link_header_cells = ["Linked Table", "Selected"]
|
let link_header_cells = ["Sel", "Available Table"]
|
||||||
.iter()
|
.iter()
|
||||||
.map(|h| Cell::from(*h).style(Style::default().fg(theme.accent)));
|
.map(|h| Cell::from(*h).style(Style::default().fg(theme.accent)));
|
||||||
let link_header = Row::new(link_header_cells).height(1).bottom_margin(1);
|
let link_header = Row::new(link_header_cells).height(1).bottom_margin(1);
|
||||||
let links_table =
|
let links_table =
|
||||||
Table::new(link_rows, [Constraint::Percentage(95), Constraint::Length(5)])
|
Table::new(link_rows, [Constraint::Length(5), Constraint::Percentage(95)])
|
||||||
.header(link_header)
|
.header(link_header)
|
||||||
.block(
|
.block(
|
||||||
Block::default()
|
Block::default()
|
||||||
|
|||||||
Reference in New Issue
Block a user