Warning, /plasma/lancelot/src/blade/ui/window.qml is written in an unsupported language. File is not indexed.

0001 /*
0002     SPDX-FileCopyrightText: 2018 Ivan Čukić <ivan.cukic(at)kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 import QtQuick 2.9
0008 
0009 import QtQuick.Window 2.2
0010 import QtQuick.Layouts 1.11
0011 import org.kde.plasma.core 2.0 as PlasmaCore
0012 import org.kde.plasma.components 2.0 as PlasmaComponents
0013 import org.kde.plasma.extras 2.0 as PlasmaExtras
0014 
0015 PlasmaCore.Dialog {
0016     id: dialog
0017 
0018     Component.onCompleted: {
0019         dialog.show();
0020     }
0021 
0022     ColumnLayout {
0023         id: root
0024 
0025         Layout.minimumWidth: 320
0026         Layout.minimumHeight: Screen.desktopAvailableHeight
0027 
0028         Connections {
0029             target: BladeUiBackend
0030             onSearchFinished: {
0031                 title.text = query;
0032             }
0033             // onSearchRequested: console.log(" <---- " + query)
0034         }
0035 
0036         PlasmaComponents.TextField {
0037             Layout.fillWidth: true
0038             onTextChanged: BladeUiBackend.search(text)
0039         }
0040 
0041         PlasmaExtras.Heading {
0042             id: title
0043         }
0044 
0045         PlasmaExtras.ScrollArea {
0046             Layout.fillWidth: true
0047             Layout.fillHeight: true
0048 
0049             ListView {
0050                 delegate: PlasmaComponents.ListItem {
0051                     height: 2 * units.smallSpacing + itemTitle.height
0052 
0053                     PlasmaComponents.Label {
0054                         id: itemTitle
0055                         anchors {
0056                             left: parent.left
0057                             top: parent.top
0058                         }
0059                         text: model.text
0060                     }
0061                 }
0062 
0063                 model: ListModel {
0064                     ListElement {
0065                         text: "Hello"
0066                     }
0067                     ListElement {
0068                         text: "World"
0069                     }
0070                 }
0071             }
0072         }
0073     }
0074 }