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 3.0 as PlasmaComponents3
0013 import org.kde.plasma.extras 2.0 as PlasmaExtras
0014 import org.kde.kirigami 2.20 as Kirigami
0015 
0016 MouseArea {
0017     id: resultDelegate
0018     property variant theModel: model
0019 
0020     width: listItem.implicitWidth
0021     height: listItem.implicitHeight
0022 
0023     hoverEnabled: true
0024     onEntered: {
0025         listView.currentIndex = index
0026     }
0027 
0028     PlasmaExtras.ListItem {
0029         id: listItem
0030         enabled: true
0031 
0032         onClicked: {
0033             listView.currentIndex = model.index
0034             listView.runCurrentIndex()
0035         }
0036 
0037         RowLayout {
0038             spacing: 7
0039 
0040             Kirigami.Icon {
0041                 id: typePixmap
0042                 width: Kirigami.Units.iconSizes.small
0043                 height: Kirigami.Units.iconSizes.small
0044 
0045                 source: model.decoration
0046             }
0047 
0048             ColumnLayout {
0049                 Layout.fillWidth: true
0050 
0051                 PlasmaComponents3.Label {
0052                     id: displayLabel
0053                     text: String(model.display)
0054 
0055                     elide: Text.ElideMiddle
0056                     maximumLineCount: 1
0057 
0058                     Layout.maximumWidth: parent.width - displayLabel.x
0059                 }
0060 
0061                 PlasmaComponents3.Label {
0062                     id: subtextLabel
0063                     text: String(model.subtext)
0064 
0065                     opacity: 0.3
0066 
0067                     elide: Text.ElideRight
0068                     maximumLineCount: 1
0069                     Layout.fillWidth: true
0070                 }
0071             }
0072         }
0073     }
0074 }