ui: hide divider column in VSplit if !self.show_divider

embed
Manos Pitsidianakis 2019-03-28 03:07:43 +02:00
parent 4629e6a22f
commit 1867bb6aa3
Signed by: Manos Pitsidianakis
GPG Key ID: 73627C2F690DF710
3 changed files with 2 additions and 5 deletions

View File

@ -67,7 +67,7 @@ fn main() {
let listing = listing::Listing::from(IndexStyle::Compact); let listing = listing::Listing::from(IndexStyle::Compact);
let b = Entity::from(Box::new(listing)); let b = Entity::from(Box::new(listing));
let tabs = Box::new(Tabbed::new(vec![ let tabs = Box::new(Tabbed::new(vec![
Box::new(VSplit::new(menu, b, 90, true)), Box::new(VSplit::new(menu, b, 90, false)),
Box::new(AccountsPanel::new(&state.context)), Box::new(AccountsPanel::new(&state.context)),
Box::new(ContactList::default()), Box::new(ContactList::default()),
])); ]));

View File

@ -253,9 +253,6 @@ impl Component for AccountMenu {
self.dirty = false; self.dirty = false;
let mut y = get_y(upper_left); let mut y = get_y(upper_left);
for a in &self.accounts { for a in &self.accounts {
for x in x..=x_max {
grid[(x, y)].set_ch('━');
}
y += 1; y += 1;
y += self.print_account(grid, (set_y(upper_left, y), bottom_right), &a, context); y += self.print_account(grid, (set_y(upper_left, y), bottom_right), &a, context);
} }

View File

@ -200,7 +200,7 @@ impl Component for VSplit {
} else { } else {
self.left.component.draw( self.left.component.draw(
grid, grid,
(upper_left, ((mid - 1), get_y(bottom_right))), (upper_left, (if self.show_divider { mid - 1 } else { mid }, get_y(bottom_right))),
context, context,
); );
self.right self.right