Warning, /utilities/kairo/src/CircuitListPage.qml is written in an unsupported language. File is not indexed.
0001 /* This file is part of Kairo Timer
0002
0003 SPDX-FileCopyrightText: 2016 (c) Kevin Ottens <ervin@kde.org>
0004
0005 SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0006
0007 */
0008
0009 import QtQuick 2.0
0010 import org.kde.kirigami 2.0 as Kirigami
0011 import Kairo 1.0
0012
0013 Kirigami.ScrollablePage {
0014 id: root
0015
0016 title: "Available Circuits"
0017 background: Rectangle {
0018 color: Kirigami.Theme.viewBackgroundColor
0019 }
0020
0021 signal circuitSelected(var circuit)
0022
0023 CircuitListModel {
0024 id: listModel
0025 }
0026
0027 Text {
0028 anchors.centerIn: parent
0029 width: parent.width - 32
0030 visible: listView.count === 0
0031 font.pixelSize: Kirigami.Theme.defaultFont.pixelSize * 2
0032 wrapMode: Text.Wrap
0033 text: "Place some circuit files in " + listModel.path
0034 }
0035
0036 ListView {
0037 id: listView
0038 anchors.fill: parent
0039 model: listModel
0040 delegate: Kirigami.BasicListItem {
0041 reserveSpaceForIcon: false
0042 label: model.display
0043 onClicked: root.circuitSelected(listModel.loadCircuit(model.index))
0044 }
0045 }
0046 }