structured data editor
git clone https://git.lucas.co/cce-data-editor.git
feat: lay out the main splitter via the scene layout engine
Replace main_splitter.set_rect with scene::bridge::layout_subtree in view(). The engine reproduces SplitBox's proportional split (grow weights = proportions, gap = divider width); the two panes are opaque leaves that keep their own internal layout. First live use of the cce-ui layout engine (Phase 2b); verified visually — panes fill correctly, resize keeps the split, divider drag works.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
src/main.rs | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/src/main.rs b/src/main.rs
index 556cde3..60af536 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1326,7 +1326,22 @@ impl Application for DataEditorApp {
let list_top = 52.0;
let list_height = (self.height as f32 - 92.0).max(100.0);
- self.main_splitter.set_rect(10.0, list_top, self.width as f32 - 20.0, list_height);
+ // Phase 2b: lay out the two-pane splitter via the scene layout engine instead of
+ // SplitBox::set_rect. The engine reproduces the proportional split (grow weights =
+ // proportions, gap = divider width); the panes are opaque leaves that lay out their
+ // own internals. See cce-ui scene::bridge.
+ let splitter_ptr: *mut (dyn cce_ui::widget::Element + 'static) =
+ &mut self.main_splitter as *mut _;
+ cce_ui::scene::bridge::layout_subtree(
+ &self.ui_context,
+ splitter_ptr,
+ cce_ui::scene::layout::Rect {
+ x: 10.0,
+ y: list_top,
+ width: self.width as f32 - 20.0,
+ height: list_height,
+ },
+ );
// Position the selected value editor inline inside the list if visible
if let Some(selected_idx) = self.selected_key_idx {