Skip to content

Commit

Permalink
fix: expand height of notice text and wrap text
Browse files Browse the repository at this point in the history
wraps display of status/error text after a send.
needed for long error messages that were being truncated.
  • Loading branch information
dan-da committed Nov 22, 2024
1 parent 90853e3 commit 0772100
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/bin/dashboard_src/send_screen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ use ratatui::widgets::Block;
use ratatui::widgets::Borders;
use ratatui::widgets::Paragraph;
use ratatui::widgets::Widget;
use ratatui::widgets::Wrap;
use tarpc::context;
use tokio::sync::Mutex;

Expand Down Expand Up @@ -447,15 +448,8 @@ impl Widget for SendScreen {
// notice
if let Ok(notice_text) = self.notice.try_lock() {
vrecter.next(1);
let notice_rect = vrecter.next(1);
let notice_widget = Paragraph::new(Span::styled(
notice_text.to_string(),
if own_focus == SendScreenWidget::Notice && self.in_focus {
focus_style
} else {
style
},
));
let notice_rect = vrecter.next(10);
let notice_widget = Paragraph::new(notice_text.as_str()).wrap(Wrap { trim: true });
notice_widget.render(notice_rect, buf);
}
}
Expand Down

0 comments on commit 0772100

Please sign in to comment.