slint icon indicating copy to clipboard operation
slint copied to clipboard

border-width on a ListView causes an error when building but works when using Slint: Show Preview

Open jamiepiccolo opened this issue 1 year ago • 1 comments

This may be the correct result when building as I couldn't find any docs showing a ListView with border-width, however it works when I use Slint: Show Preview.

Error when building in rust (tried master and 2.5.0) error: Unknown property border-width in ListView

Slint to replicate.

import {ListView} from "std-widgets.slint";


export AppWindow := Window {
    width: 1280px;
    height: 720px;
    VerticalLayout { 
        padding: 5px;
        ListView { 
            for i in 69: VerticalLayout { 
                Text {
                    text: "I'm a listview with a border";
                }
            }
         }
         ListView { 
            border-width: 0;
            for i in 69: VerticalLayout { 
                Text {
                    text: "I'm a listview without a border";
                }
             }
         }
    }
} 

jamiepiccolo avatar Sep 03 '22 15:09 jamiepiccolo

Thanks for the bug report.

border-width is not a property of the ListView. It accidentally work in some case because we leak internal stuff through inheritance in the style We probably will fix that in a future release by avoiding inheritance.

ogoffart avatar Sep 04 '22 11:09 ogoffart