can send custom text to remote devices
This commit is contained in:
parent
ad508492dd
commit
9fafc48263
1 changed files with 18 additions and 1 deletions
|
@ -196,7 +196,13 @@ impl Widget for &mut App {
|
||||||
|
|
||||||
if s == SendingScreen::Text {
|
if s == SendingScreen::Text {
|
||||||
let rect = centered_rect(area, 90, 80);
|
let rect = centered_rect(area, 90, 80);
|
||||||
// TODO: display the text widget
|
let text = if let Some(text) = self.text.as_ref() {
|
||||||
|
text
|
||||||
|
} else {
|
||||||
|
""
|
||||||
|
};
|
||||||
|
|
||||||
|
text_input(text, rect, buf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
|
@ -222,6 +228,17 @@ fn outer_frame(screen: &CurrentScreen, menu: &Line, area: Rect, buf: &mut Buffer
|
||||||
.render(area, buf);
|
.render(area, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn text_input(text: &str, area: Rect, buf: &mut Buffer) {
|
||||||
|
let title = Line::from(" Input Text ".bold());
|
||||||
|
let block = Block::bordered().title(title.centered());
|
||||||
|
ratatui::widgets::Clear::default().render(area, buf);
|
||||||
|
|
||||||
|
Paragraph::new(text)
|
||||||
|
.centered()
|
||||||
|
.block(block)
|
||||||
|
.render(area, buf);
|
||||||
|
}
|
||||||
|
|
||||||
fn logger(area: Rect, buf: &mut Buffer) {
|
fn logger(area: Rect, buf: &mut Buffer) {
|
||||||
let title = Line::from(log::max_level().as_str());
|
let title = Line::from(log::max_level().as_str());
|
||||||
let logger = TuiLoggerWidget::default()
|
let logger = TuiLoggerWidget::default()
|
||||||
|
|
Loading…
Reference in a new issue