FormElementStyle
Defines the visual settings of a form element.
Fields
title_horizontal_alignment
(length): Defines the horizontal text alignment of the title. (default value: left)title_style
(TextStyle
): Defines the style of the title.
FormElementBase
The FormElementBase
represents the base for for elements that can be styled by using FormElementStyle
.
Properties
title
(in string): A text written as the title of the form element.style
(in FormElementStyle): Defines the style of the form element.
Example
import { FormElementBase, TextBase } from "@vivi/foundation.slint";
export component MyFormElement inherits FormElementBase {
style: {
title_style: {
foreground: black,
font_size: 12px
}
};
VerticalLayout {
TextBase {
style: root.title_style;
text: root.title;
}
@children
}
}
export component Example inherits Window {
width: 200px;
height: 100px;
MyFormElement {
title: "Element";
Rectangle {
width: 60px;
height: 60px;
background: green;
}
}
}