From 077210018f73a5d321bf70e7b3320a04b145eaf2 Mon Sep 17 00:00:00 2001 From: danda Date: Fri, 22 Nov 2024 04:28:30 +0100 Subject: [PATCH] fix: expand height of notice text and wrap text wraps display of status/error text after a send. needed for long error messages that were being truncated. --- src/bin/dashboard_src/send_screen.rs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/bin/dashboard_src/send_screen.rs b/src/bin/dashboard_src/send_screen.rs index 216c85156..9fc73a269 100644 --- a/src/bin/dashboard_src/send_screen.rs +++ b/src/bin/dashboard_src/send_screen.rs @@ -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; @@ -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); } }