From a5d5f01674135645db51693b83e429c9bb4ce2b7 Mon Sep 17 00:00:00 2001 From: jess Date: Thu, 4 Jun 2026 18:27:06 -0700 Subject: [PATCH] Fixed: - MOST of the table bugs. Uh...: - Row resizing still doesn't always activate. - Sometimes the content still spills instead of wraps. It's on the todo list. Sort of. I'll wait until I'm done with breaking things to fix them completely. --- viewport/src/handle.rs | 48 ------------------------------------- viewport/src/table_block.rs | 3 ++- 2 files changed, 2 insertions(+), 49 deletions(-) diff --git a/viewport/src/handle.rs b/viewport/src/handle.rs index aacb4df..c931db1 100644 --- a/viewport/src/handle.rs +++ b/viewport/src/handle.rs @@ -629,54 +629,6 @@ pub fn render(handle: &mut ViewportHandle) { ); handle.events.clear(); - #[cfg(debug_assertions)] - { - use std::fmt::Write as _; - use iced_wgpu::core::widget::operation::{Operation, Scrollable}; - use iced_wgpu::core::widget::Id as CoreId; - use iced_wgpu::core::{Rectangle, Vector}; - - let s = &handle.state; - let mut out = String::new(); - let _ = writeln!(out, "render_mode={:?} layout={} free_placements={} preview={} settings_open={} font={}", - s.render_mode, s.layout.len(), s.free_placements.len(), s.preview, s.settings_open, s.font_size); - for (i, id) in s.layout.iter().enumerate() { - if let Some(b) = s.registry.get(id) { - let _ = write!(out, " [{i}] id={:?} kind={}", id, b.kind_tag()); - if let Some(tb) = b.as_any().downcast_ref::() { - let _ = write!(out, " rows={} cols={} widths={:?} read_only={} eval={}", - tb.rows.len(), tb.col_widths.len(), tb.col_widths, tb.read_only, tb.is_eval_result); - } - let _ = writeln!(out); - } - } - - // record laid-out bounds of scrollables and the first containers - struct BoundsProbe { scroll: Vec, conts: Vec } - impl Operation<()> for BoundsProbe { - fn traverse(&mut self, operate: &mut dyn FnMut(&mut dyn Operation<()>)) { - operate(self); - } - fn container(&mut self, id: Option<&CoreId>, bounds: Rectangle) { - if self.conts.len() < 24 { - self.conts.push(format!("cont id={:?} x={:.0} y={:.0} w={:.0} h={:.0}", - id, bounds.x, bounds.y, bounds.width, bounds.height)); - } - } - fn scrollable(&mut self, id: Option<&CoreId>, bounds: Rectangle, content: Rectangle, tx: Vector, _s: &mut dyn Scrollable) { - self.scroll.push(format!("scroll id={:?} bounds=({:.0},{:.0} {:.0}x{:.0}) content=({:.0},{:.0} {:.0}x{:.0}) tx=({:.0},{:.0})", - id, bounds.x, bounds.y, bounds.width, bounds.height, - content.x, content.y, content.width, content.height, tx.x, tx.y)); - } - } - let mut probe = BoundsProbe { scroll: Vec::new(), conts: Vec::new() }; - ui.operate(&handle.renderer, &mut probe); - for l in &probe.scroll { let _ = writeln!(out, " {l}"); } - for l in &probe.conts { let _ = writeln!(out, " {l}"); } - - let _ = std::fs::write("/tmp/acord-blank.log", out); - } - let focused_id = { use iced_wgpu::core::widget::operation::{Focusable, Operation}; use iced_wgpu::core::widget::Id as CoreId; diff --git a/viewport/src/table_block.rs b/viewport/src/table_block.rs index ebbc14b..239ae67 100644 --- a/viewport/src/table_block.rs +++ b/viewport/src/table_block.rs @@ -1342,11 +1342,12 @@ where if is_header && !read_only { let handle_col = ci; + // fixed-height column-resize grab band let handle: Element<'a, Message, Theme, iced_wgpu::Renderer> = MouseArea::new( container(text(" ")) .width(Length::Fixed(RESIZE_HANDLE_WIDTH)) - .height(Length::Fill) + .height(Length::Fixed(row_h)) ) .interaction(Interaction::ResizingHorizontally) .on_press(on_msg(TableMessage::BeginColResize(handle_col)))