Draws a centered dialog box with the given content. # Arguments `title` - Dialog title `content` - Vector of lines to display `color` - Color theme for the dialog
(&mut self, title: &str, content: &[Line], color: Color)
| 602 | /// * `content` - Vector of lines to display |
| 603 | /// * `color` - Color theme for the dialog |
| 604 | fn draw_dialog(&mut self, title: &str, content: &[Line], color: Color) { |
| 605 | let area = self.frame.area(); |
| 606 | let dialog_box = create_dialog_box(title, content, area); |
| 607 | |
| 608 | self.frame.render_widget(Clear, dialog_box); |
| 609 | self.frame.render_widget( |
| 610 | Block::default().borders(Borders::ALL).border_style(Style::default().fg(color)).title( |
| 611 | Span::styled( |
| 612 | title, |
| 613 | Style::default().fg(color).add_modifier(ratatui::style::Modifier::BOLD), |
| 614 | ), |
| 615 | ), |
| 616 | dialog_box, |
| 617 | ); |
| 618 | |
| 619 | self.frame.render_widget( |
| 620 | Paragraph::new(content.to_vec()).alignment(Alignment::Center), |
| 621 | dialog_box.inner(Margin { vertical: 1, horizontal: 2 }), |
| 622 | ); |
| 623 | } |
| 624 | } |
| 625 | |
| 626 | /// Creates a centered dialog box with appropriate dimensions. |
no test coverage detected