diff options
author | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2020-11-28 20:23:39 +0200 |
---|---|---|
committer | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2020-11-28 20:33:14 +0200 |
commit | d8c978ed2dcb86426618e89982b047d1601c7b21 (patch) | |
tree | dfa5d97a6b9e013bd0469f0ad3780c268ff24b82 /src | |
parent | d076ff573f47fb7538930171ce397e3199ceaeaf (diff) |
mail/view/thread: fix scrollbar incorrect rendering
Diffstat (limited to 'src')
-rw-r--r-- | src/components/mail/view/thread.rs | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/src/components/mail/view/thread.rs b/src/components/mail/view/thread.rs index 12fcfcaa..7d3e2c99 100644 --- a/src/components/mail/view/thread.rs +++ b/src/components/mail/view/thread.rs @@ -572,23 +572,20 @@ impl ThreadView { self.highlight_line(grid, dest_area, src_area, idx, context); if rows < visibles.len() { - ScrollBar::default().draw( + ScrollBar::default().set_show_arrows(true).draw( grid, - ( - upper_left!(area), - set_x(bottom_right, get_x(upper_left!(area)) + 1), - ), + (pos_inc(upper_left!(area), (width!(area), 0)), bottom_right), context, - self.cursor_pos, + 2 * self.cursor_pos, rows, - visibles.len(), + 2 * visibles.len() + 1, ); } - if top_idx + rows > visibles.len() { + if 2 * top_idx + rows > 2 * visibles.len() + 1 { clear_area( grid, ( - pos_inc(upper_left, (0, 2 * (visibles.len() - top_idx))), + pos_inc(upper_left, (0, 2 * (visibles.len() - top_idx) + 1)), bottom_right, ), crate::conf::value(context, "theme_default"), @@ -632,16 +629,13 @@ impl ThreadView { self.highlight_line(grid, dest_area, src_area, entry_idx, context); if rows < visibles.len() { - ScrollBar::default().draw( + ScrollBar::default().set_show_arrows(true).draw( grid, - ( - upper_left!(area), - set_x(bottom_right, get_x(upper_left!(area)) + 1), - ), + (pos_inc(upper_left!(area), (width!(area), 0)), bottom_right), context, - self.cursor_pos, + 2 * self.cursor_pos, rows, - visibles.len(), + 2 * visibles.len() + 1, ); context.dirty_areas.push_back(( upper_left!(area), |