Radish alpha
r
Radicle terminal user interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
lib: Fix table scroll in imUI
Erik Kundt committed 1 year ago
commit 672f2e1d1fbfdb5125415471f3c5f6aa409ef5e2
parent 5b8347c8e5e4484f757ed91957a6687ba543584a
1 file changed +2 -6
modified src/ui/im.rs
@@ -868,14 +868,10 @@ pub mod widget {
                        Style::default().dim()
                    });

-
                // In order to make the scrollbar work correctly towards the end of the list,
-
                // we need to add a few percent of the total length.
-
                let virtual_length =
-
                    self.items.len() * ((self.items.len() as f64).log2() as usize) / 100;
-
                let content_length = area.height as usize + virtual_length;
+
                let content_length = self.items.len();

                let mut scroller_state = ScrollbarState::default()
-
                    .content_length(self.items.len().saturating_sub(content_length))
+
                    .content_length(content_length)
                    .viewport_content_length(1)
                    .position(state.internal.offset());