Warning, /plasma/milou/lib/qml/ResultsListViewDelegate.qml is written in an unsupported language. File is not indexed.

0001 /*
0002  * This file is part of the KDE Milou Project
0003  * SPDX-FileCopyrightText: 2013-2014 Vishesh Handa <me@vhanda.in>
0004  *
0005  * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0006  *
0007  */
0008 
0009 import QtQuick 2.1
0010 import QtQuick.Layouts 1.1
0011 
0012 import org.kde.plasma.components 2.0 as PlasmaComponents // for ListItem
0013 import org.kde.plasma.components 3.0 as PlasmaComponents3
0014 import org.kde.kquickcontrolsaddons 2.0 as QtExtra
0015 import "globals.js" as Globals
0016 
0017 MouseArea {
0018     id: resultDelegate
0019     property variant theModel: model
0020 
0021     width: listItem.implicitWidth
0022     height: listItem.implicitHeight
0023 
0024     hoverEnabled: true
0025     onEntered: {
0026         listView.currentIndex = index
0027     }
0028 
0029     PlasmaComponents.ListItem {
0030         id: listItem
0031         enabled: true
0032 
0033         onClicked: {
0034             listView.currentIndex = model.index
0035             listView.runCurrentIndex()
0036         }
0037 
0038         RowLayout {
0039             spacing: 7
0040 
0041             QtExtra.QIconItem {
0042                 id: typePixmap
0043                 width: Globals.IconSize
0044                 height: Globals.IconSize
0045 
0046                 icon: model.decoration
0047                 smooth: true
0048             }
0049 
0050             ColumnLayout {
0051                 Layout.fillWidth: true
0052 
0053                 PlasmaComponents3.Label {
0054                     id: displayLabel
0055                     text: String(model.display)
0056 
0057                     elide: Text.ElideMiddle
0058                     maximumLineCount: 1
0059 
0060                     Layout.maximumWidth: parent.width - displayLabel.x
0061                 }
0062 
0063                 PlasmaComponents3.Label {
0064                     id: subtextLabel
0065                     text: String(model.subtext)
0066 
0067                     opacity: 0.3
0068 
0069                     elide: Text.ElideRight
0070                     maximumLineCount: 1
0071                     Layout.fillWidth: true
0072                 }
0073             }
0074         }
0075     }
0076 }