diff options
author | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2020-08-02 00:48:44 +0300 |
---|---|---|
committer | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2020-08-02 00:48:44 +0300 |
commit | 890000bd0e53259f325602dc91ca3a32467a429f (patch) | |
tree | 21fbcd01732e271fc8e93ffc6835e3ebf0bb8767 /src/components/mail | |
parent | c5d0a6c3b6d5c165df9e06a9fdecaa2e647e78ad (diff) |
status page: trim extension name at 30 chars
NNTP has some long protocol extension names
Diffstat (limited to 'src/components/mail')
-rw-r--r-- | src/components/mail/status.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/components/mail/status.rs b/src/components/mail/status.rs index dfe3840d..d29e4368 100644 --- a/src/components/mail/status.rs +++ b/src/components/mail/status.rs @@ -548,7 +548,11 @@ impl Component for AccountStatus { ); let max_name_width = std::cmp::max( "Server Extensions:".len(), - extensions.iter().map(|(n, _)| n.len()).max().unwrap_or(0), + extensions + .iter() + .map(|(n, _)| std::cmp::min(30, n.len())) + .max() + .unwrap_or(0), ); write_string_to_grid( "meli support:", @@ -563,7 +567,7 @@ impl Component for AccountStatus { for (i, (name, status)) in extensions.into_iter().enumerate() { let (width, height) = self.content.size(); write_string_to_grid( - &name, + name.trim_at_boundary(30), &mut self.content, self.theme_default.fg, self.theme_default.bg, |