Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
94ec4b8feThis file is pinned to the selected release. Download the original to open it in your design tool.
import {
Button,
LengthEdit,
LineEdit,
} from "../../widgets.slint";
import {
Backend,
SymbolTabData,
TabAction,
WindowSectionData,
} from "../../api.slint";
export component AddSymbolPinToolBar inherits HorizontalLayout {
in property <int> section-index;
in-out property <WindowSectionData> section;
property <[SymbolTabData]> tabs: section.symbol-tabs;
spacing: 2px;
name-edt := LineEdit {
min-width: 150px;
text: tabs[section.current-tab-index].tool-value.text;
placeholder-text: @tr("Pin Name");
text-edited(text) => {
tabs[section.current-tab-index].tool-value.text = text;
}
}
length-edt := LengthEdit {
data: tabs[section.current-tab-index].tool-size;
icon: @image-url("../../../../font-awesome/svgs/solid/arrows-left-right.svg");
tooltip: @tr("Pin Length");
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;
}
}
import-btn := Button {
icon: @image-url("../../../../font-awesome/svgs/solid/file-import.svg");
text: @tr("Mass Import");
clicked => {
Backend.trigger-tab(section-index, section.current-tab-index, TabAction.symbol-import-pins);
}
}
}