diff --git a/crates/ui-widgets/src/tile_grid/grid.rs b/crates/ui-widgets/src/tile_grid/grid.rs index 4b3d54437..1cf15fa15 100644 --- a/crates/ui-widgets/src/tile_grid/grid.rs +++ b/crates/ui-widgets/src/tile_grid/grid.rs @@ -570,8 +570,9 @@ impl Component for TileGrid<'_, K> continue; } if rule { - // A divider takes no press and no stop: it is placed for its paint only. + // A divider takes no press and no stop: its part only carries the heading node. self.placed.push(Placed { group, rect, pinned: false, toggle: false }); + cx.part(section_part(&declared.key), rect); continue; } let column = self diff --git a/crates/ui-widgets/src/tile_grid/headers.rs b/crates/ui-widgets/src/tile_grid/headers.rs index 8b7b770df..c4da27bc5 100644 --- a/crates/ui-widgets/src/tile_grid/headers.rs +++ b/crates/ui-widgets/src/tile_grid/headers.rs @@ -24,7 +24,7 @@ pub(super) struct Outline<'s, K> { /// The keys of the tail rows. tail: Vec, collapsible: bool, - /// Under `Rule` a header is a divider: it is a row of the outline but no stop. + /// Under `Rule` a header is a divider: it is a row of the outline the grid draws, but it never takes the lead. heads: GroupHeads, } @@ -97,11 +97,7 @@ impl DisplayOrder for Outline<'_, K> { } fn section_stop(&self, at: usize) -> bool { - match self.slot(at) { - Slot::Header(_) => self.heads == GroupHeads::Titled, - Slot::Tail(_) => true, - Slot::Tile(_) => false, - } + self.is_section(at) } fn section_stops_before(&self, at: usize) -> usize { @@ -110,7 +106,8 @@ impl DisplayOrder for Outline<'_, K> { fn enabled(&self, at: usize) -> bool { match self.slot(at) { - Slot::Header(_) | Slot::Tail(_) => true, + Slot::Header(_) => self.heads == GroupHeads::Titled, + Slot::Tail(_) => true, Slot::Tile(tile) => self.inner.enabled(tile), } }