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.
This commit is contained in:
parent
636137569d
commit
a5d5f01674
|
|
@ -629,54 +629,6 @@ pub fn render(handle: &mut ViewportHandle) {
|
||||||
);
|
);
|
||||||
handle.events.clear();
|
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::<crate::table_block::TableBlock>() {
|
|
||||||
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<String>, conts: Vec<String> }
|
|
||||||
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 = {
|
let focused_id = {
|
||||||
use iced_wgpu::core::widget::operation::{Focusable, Operation};
|
use iced_wgpu::core::widget::operation::{Focusable, Operation};
|
||||||
use iced_wgpu::core::widget::Id as CoreId;
|
use iced_wgpu::core::widget::Id as CoreId;
|
||||||
|
|
|
||||||
|
|
@ -1342,11 +1342,12 @@ where
|
||||||
|
|
||||||
if is_header && !read_only {
|
if is_header && !read_only {
|
||||||
let handle_col = ci;
|
let handle_col = ci;
|
||||||
|
// fixed-height column-resize grab band
|
||||||
let handle: Element<'a, Message, Theme, iced_wgpu::Renderer> =
|
let handle: Element<'a, Message, Theme, iced_wgpu::Renderer> =
|
||||||
MouseArea::new(
|
MouseArea::new(
|
||||||
container(text(" "))
|
container(text(" "))
|
||||||
.width(Length::Fixed(RESIZE_HANDLE_WIDTH))
|
.width(Length::Fixed(RESIZE_HANDLE_WIDTH))
|
||||||
.height(Length::Fill)
|
.height(Length::Fixed(row_h))
|
||||||
)
|
)
|
||||||
.interaction(Interaction::ResizingHorizontally)
|
.interaction(Interaction::ResizingHorizontally)
|
||||||
.on_press(on_msg(TableMessage::BeginColResize(handle_col)))
|
.on_press(on_msg(TableMessage::BeginColResize(handle_col)))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue