Add scrollbar in branchlist (#417)

* Add scrollbar in branchlist
* Change scrollbar symbol to DOUBLE_VERTICAL
This commit is contained in:
remique 2020-11-12 15:39:50 +01:00 committed by GitHub
parent 8bf0d78b04
commit 2f3af71408
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 4 deletions

View File

@ -78,12 +78,20 @@ impl DrawableComponent for SelectBranchComponent {
.block(
Block::default()
.title(strings::SELECT_BRANCH_POPUP_MSG)
.borders(Borders::ALL)
.border_type(BorderType::Thick),
.border_type(BorderType::Thick)
.borders(Borders::ALL),
)
.alignment(Alignment::Left),
area,
);
ui::draw_scrollbar(
f,
area,
&self.theme,
self.branch_names.len(),
self.scroll_top.get(),
);
}
Ok(())

View File

@ -5,7 +5,7 @@ use tui::{
buffer::Buffer,
layout::{Margin, Rect},
style::Style,
symbols::{block::FULL, line::THICK_VERTICAL},
symbols::{block::FULL, line::DOUBLE_VERTICAL},
widgets::Widget,
Frame,
};
@ -50,7 +50,7 @@ impl Widget for Scrollbar {
}
for y in area.top()..area.bottom() {
buf.set_string(right, y, THICK_VERTICAL, self.style_bar);
buf.set_string(right, y, DOUBLE_VERTICAL, self.style_bar);
}
let max_pos = self.lines.saturating_sub(area.height);