rust_kanban/ui/rendering/view/
title_body_log.rs1use crate::{
2 app::App,
3 ui::{
4 rendering::{
5 common::{
6 draw_title, render_body, render_card_being_dragged, render_close_button,
7 render_logs,
8 },
9 view::TitleBodyLog,
10 },
11 Renderable,
12 },
13};
14use ratatui::{
15 layout::{Constraint, Direction, Layout},
16 Frame,
17};
18
19impl Renderable for TitleBodyLog {
20 fn render(rect: &mut Frame, app: &mut App, is_active: bool) {
21 let chunks = Layout::default()
22 .direction(Direction::Vertical)
23 .constraints(
24 [
25 Constraint::Length(3),
26 Constraint::Fill(1),
27 Constraint::Length(5),
28 ]
29 .as_ref(),
30 )
31 .split(rect.area());
32
33 rect.render_widget(draw_title(app, chunks[0], is_active), chunks[0]);
34 render_body(rect, chunks[1], app, false, is_active);
35 render_logs(app, true, chunks[2], rect, is_active);
36 if app.config.enable_mouse_support {
37 render_close_button(rect, app, is_active)
38 }
39 render_card_being_dragged(chunks[1], app, rect, is_active);
40 }
41}