Loading files
import {
ComboBox,
LengthEdit,
ToolBarButton,
} from "../../widgets.slint";
import {
Data,
SchematicTabData,
WindowSectionData,
} from "../../api.slint";
export component DrawPolygonToolBar 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;
}
}
line-width-edt := LengthEdit {
data: tabs[section.current-tab-index].tool-line-width;
icon: @image-url("../../../../bootstrap-icons/icons/border-width.svg");
tooltip: @tr("Line Width");
min-width-text: "1.234";
value-changed(v) => {
tabs[section.current-tab-index].tool-line-width.value = v;
}
unit-changed(u) => {
tabs[section.current-tab-index].tool-line-width.unit = u;
}
increase-triggered => {
tabs[section.current-tab-index].tool-line-width.increase = true;
}
decrease-triggered => {
tabs[section.current-tab-index].tool-line-width.decrease = true;
}
}
fill-sw := ToolBarButton {
icon: @image-url("../../../../font-awesome/svgs/solid/fill-drip.svg");
tooltip: @tr("Fill Area");
checked: tabs[section.current-tab-index].tool-filled;
checkable: true;
clicked => {
tabs[section.current-tab-index].tool-filled = !self.checked;
}
}
}
c730ec352This file is pinned to the selected release. Download the original to open it in your design tool.