mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 10:50:00 +00:00
![]() This code would have unpredictable results: ```slint export Button := Rectangle { property<bool> the_enabled <=> touch.enabled; property<bool> the_visible <=> touch.visible; background: !the_enabled ? blue : red; border-color: !the_visible ? green : yellow; border-width: 15px; touch := TouchArea {} fs := FocusScope { enabled <=> root.the_enabled; visible <=> root.the_visible; } } Demo := Rectangle { VerticalLayout { spacing: 10px; Button { the_enabled: false; the_visible: false; } Button { the_enabled: false; the_visible: false; } Button { the_enabled: false; the_visible: false; } Button { the_enabled: false; the_visible: false; } Button { the_enabled: false; the_visible: false; } Button { the_enabled: false; the_visible: false; } Button { the_enabled: false; the_visible: false; } } } ``` Because the enabled and visible property defaults to true (default enforced by the compiler), but we set it also to false via an alias |
||
---|---|---|
.. | ||
backends | ||
common | ||
compiler | ||
core | ||
core-macros | ||
interpreter |