slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
https://slint.dev
Other
17.54k stars 600 forks source link

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

Closed jamiepiccolo closed 1 year ago

jamiepiccolo commented 2 years ago

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";
                }
             }
         }
    }
} 
ogoffart commented 2 years ago

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 commented 1 year ago

Will be fixed as part of the move of our widget to interfaces https://github.com/slint-ui/slint/issues/1870