slint
slint copied to clipboard
Using `visible` Within a ListView Breaks UI
Discussed in https://github.com/slint-ui/slint/discussions/2516
Testcase:
import { Button, VerticalBox, ListView, HorizontalBox } from "std-widgets.slint";
export component Demo {
height: 200px;
width: 200px;
property <[{text: string, should_show: bool}]> items-model:
[
{text: "123", should_show: true },
{text: "456", should_show: true },
{text: "789", should_show: false },
{text: "abc", should_show: true },
{text: "def", should_show: true },
{text: "ghi", should_show: true },
{text: "jkl", should_show: true },
];
ListView {
for item[i] in items-model : HorizontalBox {
visible: item.should_show;
Text {
text: item.text;
}
}
}
}