From 583c82148fcb40369f4f78a4414972903d64f35f Mon Sep 17 00:00:00 2001 From: Joscha Date: Tue, 19 Jul 2022 21:24:11 +0200 Subject: [PATCH] Determine some constants based on others --- src/ui/chat/tree/util.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ui/chat/tree/util.rs b/src/ui/chat/tree/util.rs index df6c763..4ee26e5 100644 --- a/src/ui/chat/tree/util.rs +++ b/src/ui/chat/tree/util.rs @@ -16,7 +16,7 @@ pub fn style_time_inverted() -> ContentStyle { } pub const INDENT: &str = "│ "; -pub const INDENT_WIDTH: usize = 2; +pub const INDENT_WIDTH: usize = INDENT.len(); pub fn style_indent() -> ContentStyle { ContentStyle::default().dark_grey() @@ -32,8 +32,7 @@ pub fn style_placeholder() -> ContentStyle { ContentStyle::default().dark_grey() } -// Something like this should fit: [+, 1234 more] -pub const MIN_CONTENT_WIDTH: usize = 14; +pub const MIN_CONTENT_WIDTH: usize = "[+, 1234 more]".len(); pub fn after_indent(indent: usize) -> i32 { (TIME_WIDTH + indent * INDENT_WIDTH) as i32