|
1 |
| -use super::{ |
2 |
| - visibility_blocking, CommandBlocking, CommandInfo, Component, |
3 |
| - DrawableComponent, |
| 1 | +use crate::{ |
| 2 | + components::{ |
| 3 | + popup_paragraph, visibility_blocking, CommandBlocking, |
| 4 | + CommandInfo, Component, DrawableComponent, |
| 5 | + }, |
| 6 | + strings, ui, |
| 7 | + ui::style::Theme, |
4 | 8 | };
|
5 |
| -use crate::{strings, ui, ui::style::Theme}; |
6 | 9 | use anyhow::Result;
|
7 | 10 | use crossterm::event::{Event, KeyCode};
|
8 | 11 | use std::borrow::Cow;
|
9 | 12 | use strings::commands;
|
10 | 13 | use tui::{
|
11 | 14 | backend::Backend,
|
12 |
| - layout::{Alignment, Rect}, |
| 15 | + layout::Rect, |
13 | 16 | style::Style,
|
14 |
| - widgets::{Block, BorderType, Borders, Clear, Paragraph, Text}, |
| 17 | + widgets::{Clear, Text}, |
15 | 18 | Frame,
|
16 | 19 | };
|
17 | 20 |
|
@@ -73,14 +76,7 @@ impl DrawableComponent for TextInputComponent {
|
73 | 76 | let area = ui::centered_rect(60, 20, f.size());
|
74 | 77 | f.render_widget(Clear, area);
|
75 | 78 | f.render_widget(
|
76 |
| - Paragraph::new(txt.iter()) |
77 |
| - .block( |
78 |
| - Block::default() |
79 |
| - .title(self.title.as_str()) |
80 |
| - .borders(Borders::ALL) |
81 |
| - .border_type(BorderType::Thick), |
82 |
| - ) |
83 |
| - .alignment(Alignment::Left), |
| 79 | + popup_paragraph(self.title.as_str(), txt.iter()), |
84 | 80 | area,
|
85 | 81 | );
|
86 | 82 | }
|
|
0 commit comments