From 6b944557588b66118fb860f38b55a98b1035d306 Mon Sep 17 00:00:00 2001 From: Jeremy Wall Date: Wed, 27 Nov 2024 19:35:23 -0500 Subject: [PATCH] wip: Don't skip around so much when changing the size portion of #5 --- src/book/mod.rs | 2 +- src/ui/render/viewport.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/book/mod.rs b/src/book/mod.rs index 742db65..a8b04a1 100644 --- a/src/book/mod.rs +++ b/src/book/mod.rs @@ -16,7 +16,7 @@ use crate::ui::Address; #[cfg(test)] mod test; -const COL_PIXELS: f64 = 10.0; +const COL_PIXELS: f64 = 5.0; /// A spreadsheet book with some internal state tracking. pub struct Book { diff --git a/src/ui/render/viewport.rs b/src/ui/render/viewport.rs index f5dc763..a81b2b8 100644 --- a/src/ui/render/viewport.rs +++ b/src/ui/render/viewport.rs @@ -106,6 +106,7 @@ impl<'book> Viewport<'book> { // subtract the first columns size. length = length - first.length; // remove the first column. + // TODO(jwall): This is a bit inefficient. Can we do better? visible = visible.into_iter().skip(1).collect(); } // Add this col to the visible. @@ -193,7 +194,7 @@ impl<'book> Viewport<'book> { col_constraints.extend(constraints.into_iter()); Ok(Table::new(rows, col_constraints) .header(Row::new(header).underlined()) - .column_spacing(1) + .column_spacing(0) .flex(Flex::Start)) } }