Declarative contracts concept
- Closes #124
Vertical,Horizontal,Stacked, etc moved todeclarativenamespace (you'll probably need spreadusing namespace declarative;- declarative syntax of
Buttonnow requires an onClick handler:
Button { "1" }, // fail
Button { .text = "2", .onClick = []{} }, // ok
-
container-like declarative syntax of
Buttonis moved toButtonExto match withAButtonEx -
Fixed the following scenario:
Before:
_new<Label>() & mCounter.readProjected(AString::number<int>)
After:
Label { AUI_REACT("{}"_format(mCounter)) }
I thought operator& and operator&& is an expressive way to make bindings, but it is just make things a lot more complex. I found myself avoiding & and && by making these functor structs and static functions.
AUI is heading against OOP. FP is better for UIs. In OOP world, nothing more than basic types such as label, atext, ascrollarea, atextfield, atextarea and containers are needed. Everything else is just a composition of basic types.
/gemini review
/gemini review