slint icon indicating copy to clipboard operation
slint copied to clipboard

Using `visible` Within a ListView Breaks UI

Open ogoffart opened this issue 1 year ago • 3 comments

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;
            }
        }
    }
}

Demo

image

ogoffart avatar Apr 12 '23 07:04 ogoffart