Closed xanahopper closed 1 year ago
Sorry to keep you waiting.
You added the BoxLayoutWidget
trait, but we lay out widgets using “box constraints'' by default in Frui. You can see this in the layout
method of RenderWidget
which takes the Constraints
argument – the same as in RenderBox
in Flutter.
As for the compute_max_intrinsic_width
method and the similar, I think we can add them directly to the RenderWidget
. Alternatively (and I really would like to try this option out) we could implement the measure
method from Xilem
, which seems to do the exact thing we need here!
Yes, adding toRenderWidget
directly and splitting the layout into measure and layout are considered.
BoxLayoutWidget
is declared because I want to keep a position for the Scrolling/Sliver model, but now it seems unnecessary.
And I'm trying some patterns to simulate the OOP abstraction design and defined some default behaviors that can be overridden, but I think it's not suitable for Rust.
I'll change these directly to RenderWidget
later in this PR.
@toiglak BoxLayoutWidget
has been removed, and methods in this move to RenderWidget
with the default implementation.
Flex PR #9 is based on this.
Widgets
ConstrainedBox
UncontrainedBox
ColoredBox
SizedBox
Traits
BoxLayoutWidget
, common for box-model measure and layoutChildWidget
, widgets with children.