Improve handling of nested layouts

We support directly nested layouts, but we did not support indirect
nesting:

    GridLayout {
        Rectangle {
            l2 := GridLayout { ... }
        }
    }

This patch fixes that by detecting this scenario and merging the layout
info of the element (Rectangle) and the layout inside (l2). This makes
it much easier to create re-usable components that use layouts
themselves and allows placing them in layouts.
This commit is contained in:
Simon Hausmann 2020-08-27 10:43:06 +02:00
parent c1aa4b28c6
commit 7976a4057f
11 changed files with 216 additions and 61 deletions

View file

@ -159,6 +159,7 @@ inline InputEventResult process_input_event(ComponentRef component, int64_t &mou
using cbindgen_private::grid_layout_info;
using cbindgen_private::GridLayoutCellData;
using cbindgen_private::GridLayoutData;
using cbindgen_private::LayoutInfo;
using cbindgen_private::PathLayoutData;
using cbindgen_private::PathLayoutItemData;
using cbindgen_private::solve_grid_layout;