summaryrefslogtreecommitdiffstats
path: root/src/constants.rs
diff options
context:
space:
mode:
authorClement Tsang <34804052+ClementTsang@users.noreply.github.com>2023-04-21 00:07:45 -0400
committerGitHub <noreply@github.com>2023-04-21 00:07:45 -0400
commit8b81dfba47a174bf68eb49e1b257602710972c7b (patch)
tree31e357885a5b29f45ffe0c65f0c653a94152b007 /src/constants.rs
parent3618449d42f4cc5b667d8a9730b5e6fbe43d7dfb (diff)
bug: fix side borders in basic mode (#1110)
Seems like I broke this when migrating from tui-rs to ratatui. This just uses explicit enum variants to set my side borders and a test to try and make sure this doesn't happen again.
Diffstat (limited to 'src/constants.rs')
-rw-r--r--src/constants.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/constants.rs b/src/constants.rs
index 4db8951e..2e6475f2 100644
--- a/src/constants.rs
+++ b/src/constants.rs
@@ -1,4 +1,5 @@
use once_cell::sync::Lazy;
+use tui::widgets::Borders;
use crate::options::ConfigColours;
@@ -21,7 +22,7 @@ pub const TABLE_GAP_HEIGHT_LIMIT: u16 = 7;
pub const TIME_LABEL_HEIGHT_LIMIT: u16 = 7;
// Side borders
-pub const SIDE_BORDERS: tui::widgets::Borders = tui::widgets::Borders::from_bits_truncate(20);
+pub const SIDE_BORDERS: Borders = Borders::LEFT.union(Borders::RIGHT);
pub static DEFAULT_TEXT_STYLE: Lazy<tui::style::Style> =
Lazy::new(|| tui::style::Style::default().fg(tui::style::Color::Gray));
pub static DEFAULT_HEADER_STYLE: Lazy<tui::style::Style> =
@@ -738,4 +739,14 @@ mod test {
"the two should be equal, or this test should be updated"
)
}
+
+ /// This test exists because previously, [`SIDE_BORDERS`] was set incorrectly after I moved from
+ /// tui-rs to ratatui.
+ #[test]
+ fn assert_side_border_bits_match() {
+ assert_eq!(
+ SIDE_BORDERS,
+ Borders::ALL.difference(Borders::TOP.union(Borders::BOTTOM))
+ )
+ }
}