(frame: &mut Frame<'_>, app: &mut App)
| 24 | use crate::theme::Theme; |
| 25 | |
| 26 | pub fn draw(frame: &mut Frame<'_>, app: &mut App) { |
| 27 | // Splash screen is a full-screen takeover — no chrome. |
| 28 | if app.screen == Screen::Splash { |
| 29 | splash::draw(frame, frame.size(), &app.theme); |
| 30 | return; |
| 31 | } |
| 32 | |
| 33 | let chunks = Layout::default() |
| 34 | .direction(Direction::Vertical) |
| 35 | .constraints([ |
| 36 | Constraint::Length(1), // title bar |
| 37 | Constraint::Min(0), // main content |
| 38 | Constraint::Length(1), // nav bar |
| 39 | Constraint::Length(1), // command bar |
| 40 | ]) |
| 41 | .split(frame.size()); |
| 42 | |
| 43 | draw_title_bar(frame, app, chunks[0]); |
| 44 | |
| 45 | match app.screen { |
| 46 | Screen::Splash => unreachable!(), |
| 47 | Screen::Dashboard => dashboard::draw(frame, app, chunks[1]), |
| 48 | Screen::Sandbox => draw_sandbox_screen(frame, app, chunks[1]), |
| 49 | } |
| 50 | |
| 51 | draw_nav_bar(frame, app, chunks[2]); |
| 52 | draw_command_bar(frame, app, chunks[3]); |
| 53 | |
| 54 | // Modal overlays (drawn last so they're on top). |
| 55 | if app.create_form.is_some() { |
| 56 | create_sandbox::draw(frame, app, frame.size()); |
| 57 | } |
| 58 | if app.create_provider_form.is_some() { |
| 59 | create_provider::draw(frame, app, frame.size()); |
| 60 | } |
| 61 | if app.provider_detail.is_some() { |
| 62 | create_provider::draw_detail(frame, app, frame.size()); |
| 63 | } |
| 64 | if app.update_provider_form.is_some() { |
| 65 | create_provider::draw_update(frame, app, frame.size()); |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | // --------------------------------------------------------------------------- |
| 70 | // Sandbox full-screen |
no test coverage detected