listing/conversations: remove entry padding box character

Remove padding each entry with '░' box character.
master
Manos Pitsidianakis 2020-11-13 18:34:50 +02:00
parent 66c6b62aa6
commit b411daddaa
Signed by: Manos Pitsidianakis
GPG Key ID: 73627C2F690DF710
7 changed files with 16 additions and 69 deletions

View File

@ -251,12 +251,8 @@ mail.listing.conversations.from
.It
mail.listing.conversations.date
.It
mail.listing.conversations.padding
.It
mail.listing.conversations.unseen
.It
mail.listing.conversations.unseen_padding
.It
mail.listing.conversations.highlighted
.It
mail.listing.conversations.selected

View File

@ -14,11 +14,9 @@ color_aliases = { "neon_green" = "#6ef9d4", "darkgrey" = "#4a4a4a", "neon_purp
"mail.listing.conversations.date" = { fg = "$neon_purple", bg = "theme_default", attrs = "theme_default" }
"mail.listing.conversations.from" = { fg = "$darkgrey", bg = "theme_default", attrs = "theme_default" }
"mail.listing.conversations.highlighted" = { fg = "theme_default", bg = "Grey58", attrs = "theme_default" }
"mail.listing.conversations.padding" = { fg = "Black", bg = "Black", attrs = "theme_default" }
"mail.listing.conversations.selected" = { fg = "theme_default", bg = "LightCoral", attrs = "theme_default" }
"mail.listing.conversations.subject" = { fg = "theme_default", bg = "theme_default", attrs = "theme_default" }
"mail.listing.conversations.unseen" = { fg = "Black", bg = "Grey78", attrs = "theme_default" }
"mail.listing.conversations.unseen_padding" = { fg = "Black", bg = "Black", attrs = "theme_default" }
"mail.listing.plain.even" = { fg = "theme_default", bg = "Grey19", attrs = "theme_default" }
"mail.listing.plain.even_highlighted" = { fg = "theme_default", bg = "Grey58", attrs = "theme_default" }
"mail.listing.plain.even_selected" = { fg = "theme_default", bg = "LightCoral", attrs = "theme_default" }

View File

@ -13,11 +13,9 @@
"mail.listing.conversations" = { fg = "theme_default", bg = "theme_default", attrs = "theme_default" }
"mail.listing.conversations.from" = { fg = "theme_default", bg = "theme_default", attrs = "theme_default" }
"mail.listing.conversations.highlighted" = { fg = "theme_default", bg = "Grey58", attrs = "theme_default" }
"mail.listing.conversations.padding" = { fg = "Grey15", bg = "Grey15", attrs = "theme_default" }
"mail.listing.conversations.selected" = { fg = "theme_default", bg = "LightCoral", attrs = "theme_default" }
"mail.listing.conversations.subject" = { fg = "theme_default", bg = "theme_default", attrs = "theme_default" }
"mail.listing.conversations.unseen" = { fg = "Black", bg = "Grey78", attrs = "theme_default" }
"mail.listing.conversations.unseen_padding" = { fg = "theme_default", bg = "theme_default", attrs = "theme_default" }
"mail.listing.plain.even" = { fg = "theme_default", bg = "theme_default", attrs = "theme_default" }
"mail.listing.plain.odd" = { fg = "theme_default", bg = "theme_default", attrs = "theme_default" }
"mail.listing.plain.even_unseen" = { fg = "theme_default", bg = "theme_default", attrs = "theme_default" }

View File

@ -16,11 +16,9 @@ color_aliases = { "JewelGreen" = "#157241", "PinkLace" = "#FFD5FD", "TorchRed" =
"mail.listing.conversations" = { fg = "theme_default", bg = "theme_default", attrs = "theme_default" }
"mail.listing.conversations.from" = { fg = "theme_default", bg = "theme_default", attrs = "theme_default" }
"mail.listing.conversations.highlighted" = { fg = "$JewelGreen", bg = "$SunsetOrange", attrs = "theme_default" }
"mail.listing.conversations.padding" = { fg = "$TorchRed", bg = "Grey15", attrs = "theme_default" }
"mail.listing.conversations.selected" = { fg = "theme_default", bg = "LightCoral", attrs = "theme_default" }
"mail.listing.conversations.subject" = { fg = "theme_default", bg = "theme_default", attrs = "theme_default" }
"mail.listing.conversations.unseen" = { fg = "Black", bg = "mail.listing.compact.even_unseen", attrs = "theme_default" }
"mail.listing.conversations.unseen_padding" = { fg = "$BlueStone", bg = "mail.listing.conversations.unseen", attrs = "theme_default" }
"mail.listing.plain.even" = { fg = "theme_default", bg = "theme_default", attrs = "theme_default" }
"mail.listing.plain.odd" = { fg = "theme_default", bg = "theme_default", attrs = "theme_default" }
"mail.listing.plain.even_unseen" = { fg = "theme_default", bg = "mail.listing.compact.even_unseen", attrs = "theme_default" }

View File

@ -88,8 +88,6 @@ struct ColorCache {
subject: ThemeAttribute,
from: ThemeAttribute,
date: ThemeAttribute,
padding: ThemeAttribute,
unseen_padding: ThemeAttribute,
}
#[derive(Debug)]

View File

@ -172,13 +172,8 @@ impl MailListingTrait for ConversationsListing {
subject: crate::conf::value(context, "mail.listing.conversations.subject"),
from: crate::conf::value(context, "mail.listing.conversations.from"),
date: crate::conf::value(context, "mail.listing.conversations.date"),
padding: crate::conf::value(context, "mail.listing.conversations.padding"),
selected: crate::conf::value(context, "mail.listing.conversations.selected"),
unseen: crate::conf::value(context, "mail.listing.conversations.unseen"),
unseen_padding: crate::conf::value(
context,
"mail.listing.conversations.unseen_padding",
),
highlighted: crate::conf::value(context, "mail.listing.conversations.highlighted"),
attachment_flag: crate::conf::value(context, "mail.listing.attachment_flag"),
thread_snooze_flag: crate::conf::value(context, "mail.listing.thread_snooze_flag"),
@ -350,8 +345,6 @@ impl MailListingTrait for ConversationsListing {
let width = max_entry_columns;
self.content = CellBuffer::new_with_context(width, 4 * rows.len(), None, context);
let padding_fg = self.color_cache.padding.fg;
for ((idx, (thread_hash, root_env_hash)), strings) in rows {
if !context.accounts[&self.cursor_pos.0].contains_key(root_env_hash) {
panic!();
@ -472,8 +465,8 @@ impl MailListingTrait for ConversationsListing {
}
for x in 0..width {
self.content[(x, 3 * idx + 2)]
.set_ch('▓')
.set_fg(padding_fg)
.set_ch(Self::PADDING_CHAR)
.set_fg(row_attr.fg)
.set_bg(row_attr.bg);
}
}
@ -525,12 +518,6 @@ impl ListingTrait for ConversationsListing {
self.selection[&thread_hash]
);
let padding_fg = if thread.unseen() > 0 {
self.color_cache.unseen_padding.fg
} else {
self.color_cache.padding.fg
};
copy_area(
grid,
&self.content,
@ -553,7 +540,7 @@ impl ListingTrait for ConversationsListing {
.set_attrs(row_attr.attrs);
grid[(x, y + 2)]
.set_fg(padding_fg)
.set_fg(row_attr.fg)
.set_bg(row_attr.bg)
.set_attrs(row_attr.attrs);
}
@ -572,7 +559,7 @@ impl ListingTrait for ConversationsListing {
.set_attrs(row_attr.attrs);
grid[(x, y + 2)]
.set_fg(padding_fg)
.set_fg(row_attr.fg)
.set_bg(row_attr.bg)
.set_attrs(row_attr.attrs);
}
@ -716,35 +703,35 @@ impl ListingTrait for ConversationsListing {
/* fill any remaining columns, if our view is wider than self.content */
let width = self.content.size().0;
let padding_fg = self.color_cache.padding.fg;
if width < width!(area) {
let y_offset = get_y(upper_left);
for y in 0..rows {
let fg_color = grid[(get_x(upper_left) + width - 1, y_offset + 3 * y)].fg();
let bg_color = grid[(get_x(upper_left) + width - 1, y_offset + 3 * y)].bg();
for x in (get_x(upper_left) + width)..=get_x(bottom_right) {
grid[(x, y_offset + 3 * y)].set_bg(bg_color);
grid[(x, y_offset + 3 * y + 1)]
.set_ch('▁')
.set_fg(self.color_cache.theme_default.fg)
.set_fg(fg_color)
.set_bg(bg_color);
grid[(x, y_offset + 3 * y + 2)]
.set_ch('▓')
.set_fg(padding_fg)
.set_ch(Self::PADDING_CHAR)
.set_fg(fg_color)
.set_bg(bg_color);
}
}
if pad > 0 {
let y = 3 * rows;
let fg_color = grid[(get_x(upper_left) + width - 1, y_offset + y)].fg();
let bg_color = grid[(get_x(upper_left) + width - 1, y_offset + y)].bg();
for x in (get_x(upper_left) + width)..=get_x(bottom_right) {
grid[(x, y_offset + y)].set_bg(bg_color);
grid[(x, y_offset + y + 1)].set_ch('▁');
grid[(x, y_offset + y + 1)].set_bg(bg_color);
grid[(x, y_offset + y + 1)].set_ch('▁').set_bg(bg_color);
if pad == 2 {
grid[(x, y_offset + y + 2)]
.set_ch('▓')
.set_fg(padding_fg)
.set_ch(Self::PADDING_CHAR)
.set_fg(fg_color)
.set_bg(bg_color);
}
}
@ -870,6 +857,8 @@ impl fmt::Display for ConversationsListing {
impl ConversationsListing {
const DESCRIPTION: &'static str = "conversations listing";
const PADDING_CHAR: char = ' '; //░';
pub fn new(coordinates: (AccountHash, MailboxHash)) -> Self {
ConversationsListing {
cursor_pos: (coordinates.0, 1, 0),
@ -1040,12 +1029,6 @@ impl ConversationsListing {
self.selection[&thread_hash]
);
let padding_fg = if thread.unseen() > 0 {
self.color_cache.unseen_padding.fg
} else {
self.color_cache.padding.fg
};
let mut from_address_list = Vec::new();
let mut from_address_set: std::collections::HashSet<Vec<u8>> =
std::collections::HashSet::new();
@ -1183,8 +1166,8 @@ impl ConversationsListing {
}
for c in self.content.row_iter(0..width, 3 * idx + 2) {
self.content[c]
.set_ch('▓')
.set_fg(padding_fg)
.set_ch(Self::PADDING_CHAR)
.set_fg(row_attr.fg)
.set_bg(row_attr.bg);
}
}

View File

@ -286,9 +286,7 @@ const DEFAULT_KEYS: &[&str] = &[
"mail.listing.conversations.subject",
"mail.listing.conversations.from",
"mail.listing.conversations.date",
"mail.listing.conversations.padding",
"mail.listing.conversations.unseen",
"mail.listing.conversations.unseen_padding",
"mail.listing.conversations.highlighted",
"mail.listing.conversations.selected",
"mail.view.headers",
@ -1517,28 +1515,6 @@ impl Default for Themes {
fg: Color::Magenta,
}
);
add!(
"mail.listing.conversations.padding",
dark = {
fg: Color::Byte(235),
bg: Color::Byte(235),
},
light = {
fg: Color::Byte(254),
bg: Color::Byte(254),
}
);
add!(
"mail.listing.conversations.unseen_padding",
dark = {
fg: Color::Byte(235),
bg: Color::Byte(235),
},
light = {
fg: Color::Byte(254),
bg: Color::Byte(254),
}
);
add!(
"mail.listing.conversations.unseen",
dark = {