basic manual entry format finished

This commit is contained in:
Nickiel12 2023-08-12 12:03:25 -07:00
parent 871d6317ff
commit 3e247b98c4

View file

@ -5,7 +5,7 @@ use crate::{
use crossterm::event::{KeyCode, KeyEvent, KeyEventKind}; use crossterm::event::{KeyCode, KeyEvent, KeyEventKind};
use ratatui::{ use ratatui::{
backend::Backend, backend::Backend,
layout::{Constraint, Direction, Layout, Rect}, layout::{Constraint, Direction, Layout, Rect, Alignment},
style::{Color, Style}, style::{Color, Style},
text::Text, text::Text,
widgets::{Block, Borders, Paragraph}, widgets::{Block, Borders, Paragraph},
@ -201,11 +201,12 @@ pub fn render_manual_row<B: Backend>(
let horizontal_pieces = Layout::default() let horizontal_pieces = Layout::default()
.direction(Direction::Horizontal) .direction(Direction::Horizontal)
.constraints([Constraint::Percentage(50), Constraint::Percentage(50)]) .constraints([Constraint::Percentage(35), Constraint::Percentage(45), Constraint::Percentage(20)])
.split(row_area); .split(row_area);
f.render_widget( f.render_widget(
Paragraph::new(Text::styled(left_text, Style::default().fg(Color::Yellow))), Paragraph::new(Text::styled(left_text, Style::default().fg(Color::Yellow)))
.alignment(Alignment::Right),
horizontal_pieces[0], horizontal_pieces[0],
); );
@ -216,10 +217,12 @@ pub fn render_manual_row<B: Backend>(
}; };
f.render_widget( f.render_widget(
Paragraph::new(Text::styled(right_text, Style::default().fg(Color::Black))).block( Paragraph::new(Text::styled(right_text, Style::default().fg(Color::Black)))
Block::default() .alignment(Alignment::Center)
.borders(Borders::NONE) .block(
.style(Style::default().bg(right_bg_color)), Block::default()
.borders(Borders::NONE)
.style(Style::default().bg(right_bg_color)),
), ),
horizontal_pieces[1], horizontal_pieces[1],
); );