Loading files
c730ec352This file is pinned to the selected release. Download the original to open it in your design tool.
import {
ComboBox,
IconButton,
LengthEdit,
LineEdit,
} from "../../widgets.slint";
import {
SchematicTabData,
WindowSectionData,
} from "../../api.slint";
export component AddTextToolBar inherits HorizontalLayout {
in property <int> section-index;
in-out property <WindowSectionData> section;
property <[SchematicTabData]> tabs: section.schematic-tabs;
spacing: 2px;
layer-cbx := ComboBox {
model: tabs[section.current-tab-index].tool-layer.items;
current-index: tabs[section.current-tab-index].tool-layer.current-index;
current-index-changed(index) => {
tabs[section.current-tab-index].tool-layer.current-index = index;
}
}
text-edt := LineEdit {
min-width: 200px;
text: tabs[section.current-tab-index].tool-value.text;
placeholder-text: @tr("Enter text here...");
suggestions: tabs[section.current-tab-index].tool-value.suggestions;
text-edited(text) => {
tabs[section.current-tab-index].tool-value.text = text;
}
}
height-edt := LengthEdit {
data: tabs[section.current-tab-index].tool-size;
icon: @image-url("../../../../font-awesome/svgs/solid/text-height.svg");
tooltip: @tr("Text Height");
min-width-text: "1.234";
value-changed(v) => {
tabs[section.current-tab-index].tool-size.value = v;
}
unit-changed(u) => {
tabs[section.current-tab-index].tool-size.unit = u;
}
increase-triggered => {
tabs[section.current-tab-index].tool-size.increase = true;
}
decrease-triggered => {
tabs[section.current-tab-index].tool-size.decrease = true;
}
}
}