Loading files
6f2f93adaThis file is pinned to the selected release. Download the original to open it in your design tool.
import { Data } from "../api.slint";
export component MessageBanner inherits Rectangle {
in property <bool> shown: true;
in property <string> text;
in property <color> text-color: Data.theme.warning-text;
width: 100%;
height: shown ? self.preferred-height : 0;
background: Data.theme.warning;
visible: self.height > 0;
clip: true;
animate height { duration: 150ms; }
VerticalLayout {
padding: 5px;
spacing: 5px;
if !text.is-empty: txt := Text {
color: text-color;
font-weight: 700;
horizontal-alignment: left;
vertical-alignment: center;
wrap: word-wrap;
text: text;
}
@children
}
}