// Copyright © SixtyFPS GmbH // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial import { LineEdit, Button, Slider, StandardListView, GridBox, HorizontalBox } from "std-widgets.slint"; component MainWindow inherits Window { GridBox { Text { text: "Filter prefix:"; vertical-alignment: center; horizontal-alignment: right; } LineEdit { text <=> root.prefix; edited => { root.prefixEdited() } } list := StandardListView { row: 1; rowspan: 3; colspan: 2; model: root.names-list; } Text { col: 2; row: 1; text: "Name: "; vertical-alignment: center; horizontal-alignment: right; } LineEdit { text <=> root.name; } Text { col: 2; row: 2; text: "Surname: "; vertical-alignment: center; horizontal-alignment: right; } LineEdit { text <=> root.surname; } HorizontalBox { padding-left: 0; padding-bottom: 0; row: 4; alignment: start; Button { text: "Create"; clicked => { root.createClicked() } } Button { text: "Update"; enabled: list.current-item != -1 && list.current-item < root.names-list.length; clicked => { root.updateClicked() } } Button { text: "Delete"; enabled: list.current-item != -1 && list.current-item < root.names-list.length; clicked => { root.deleteClicked() } } } } in property <[StandardListViewItem]> names-list; out property current-item: list.current-item; out property name; out property surname; out property prefix; callback prefixEdited(); callback createClicked(); callback updateClicked(); callback deleteClicked(); }