summaryrefslogtreecommitdiffstats
path: root/src/utils
diff options
context:
space:
mode:
authorClement Tsang <34804052+ClementTsang@users.noreply.github.com>2024-02-03 19:59:12 -0500
committerGitHub <noreply@github.com>2024-02-03 19:59:12 -0500
commitb6660610d02a88aeb23fbcda8378be67a85259e7 (patch)
tree630345cf215dc0e894a8a6f70a60eedea71c5d0f /src/utils
parent8d84b688b004b9c6f383e446a4048cadf1000a31 (diff)
deps: bump ratatui to 0.26 (#1406)
* deps: bump ratatui to 0.26 * adjust process width * a few nonzero optimizations * add a todo * update comments to be less confusing about time chart
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/general.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/utils/general.rs b/src/utils/general.rs
index 20df9bb7..3c0c062a 100644
--- a/src/utils/general.rs
+++ b/src/utils/general.rs
@@ -1,6 +1,9 @@
use std::{cmp::Ordering, num::NonZeroUsize};
-use tui::text::{Line, Span, Text};
+use tui::{
+ style::Style,
+ text::{Line, Span, Text},
+};
use unicode_segmentation::UnicodeSegmentation;
use unicode_width::UnicodeWidthStr;
@@ -64,6 +67,8 @@ pub fn get_decimal_prefix(quantity: u64, unit: &str) -> (f64, String) {
pub fn truncate_to_text<'a, U: Into<usize>>(content: &str, width: U) -> Text<'a> {
Text {
lines: vec![Line::from(vec![Span::raw(truncate_str(content, width))])],
+ style: Style::default(),
+ alignment: None,
}
}