centered form
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
// src/ui/handlers/render.rs
|
||||
|
||||
use crate::components::{render_command_line, render_status_line};
|
||||
use crate::components::{render_background, render_command_line, render_status_line};
|
||||
use crate::config::colors::Theme;
|
||||
use ratatui::layout::{Constraint, Direction, Layout};
|
||||
use ratatui::Frame;
|
||||
@@ -20,6 +20,8 @@ pub fn render_ui(
|
||||
command_message: &str,
|
||||
ui_state: &UiState,
|
||||
) {
|
||||
render_background(f, f.size(), theme);
|
||||
|
||||
// Root layout - vertical split for main content, status, and command line
|
||||
let root = Layout::default()
|
||||
.direction(Direction::Vertical)
|
||||
@@ -47,19 +49,20 @@ pub fn render_ui(
|
||||
(None, main_content_area)
|
||||
};
|
||||
|
||||
// Split content area into form and preview
|
||||
let content_chunks = Layout::default()
|
||||
// Create centered form layout
|
||||
let form_layout = Layout::default()
|
||||
.direction(Direction::Horizontal)
|
||||
.constraints([
|
||||
Constraint::Percentage(60),
|
||||
Constraint::Percentage(40),
|
||||
Constraint::Min(0),
|
||||
Constraint::Max(80),
|
||||
Constraint::Min(0),
|
||||
])
|
||||
.split(content_area);
|
||||
|
||||
// Render form in the left content area
|
||||
form_state.render(
|
||||
f,
|
||||
content_chunks[0],
|
||||
form_layout[1],
|
||||
theme,
|
||||
is_edit_mode,
|
||||
total_count,
|
||||
|
||||
Reference in New Issue
Block a user