For example, button("text", cx) could be shorthand for Button::new("text").build(cx), and this could be a standard pattern for simple components.
The question is: would the simple form be usable in enough places to make it worthwhile? I hope that styling/layout information could be managed out-of-band - perhaps loaded from a file and then mapped onto the widget tree using the stable widget identities, so that you would rarely need to stray from this short form.
Some components might have multiple variations, eg. image_button(..., cx) but if there are more than a couple of common forms it would be better to revert back to the factory style for that component.
For example,
button("text", cx)could be shorthand forButton::new("text").build(cx), and this could be a standard pattern for simple components.The question is: would the simple form be usable in enough places to make it worthwhile? I hope that styling/layout information could be managed out-of-band - perhaps loaded from a file and then mapped onto the widget tree using the stable widget identities, so that you would rarely need to stray from this short form.
Some components might have multiple variations, eg.
image_button(..., cx)but if there are more than a couple of common forms it would be better to revert back to the factory style for that component.