2017-08-29 23:58:49 +02:00
|
|
|
import QtQuick 2.7
|
|
|
|
import QtQuick.Layouts 1.1
|
2019-02-27 20:41:50 +01:00
|
|
|
import org.kde.plasma.core 2.0 as PlasmaCore
|
2020-11-27 19:09:47 +01:00
|
|
|
import org.kde.plasma.components 3.0 as PlasmaComponents3
|
2017-08-29 23:58:49 +02:00
|
|
|
|
2018-06-30 17:45:03 +02:00
|
|
|
Item {
|
2017-10-01 17:49:48 +02:00
|
|
|
id: detailItem
|
2018-06-30 17:45:03 +02:00
|
|
|
|
2017-10-01 17:49:48 +02:00
|
|
|
property string detailName: name ? name : ""
|
|
|
|
property string detailValue: detail ? detail : ""
|
|
|
|
|
2018-06-30 17:45:03 +02:00
|
|
|
width: detailRow.implicitWidth
|
|
|
|
height: detailRow.implicitHeight
|
2017-10-05 00:10:18 +02:00
|
|
|
|
2018-06-30 17:45:03 +02:00
|
|
|
RowLayout {
|
|
|
|
id: detailRow
|
2019-02-27 20:41:50 +01:00
|
|
|
width: parent.width
|
2018-06-30 17:45:03 +02:00
|
|
|
|
2019-02-27 20:41:50 +01:00
|
|
|
PlasmaCore.IconItem {
|
|
|
|
source: detailIcon
|
|
|
|
Layout.leftMargin: units.iconSizes.small * 1.1
|
|
|
|
Layout.preferredWidth: units.iconSizes.small
|
|
|
|
Layout.preferredHeight: units.iconSizes.small
|
|
|
|
opacity: 0.8
|
|
|
|
}
|
2020-11-27 19:09:47 +01:00
|
|
|
PlasmaComponents3.Label {
|
2018-06-30 17:45:03 +02:00
|
|
|
Layout.preferredWidth: 100
|
2019-02-27 20:41:50 +01:00
|
|
|
text: detailName
|
2018-06-30 17:45:03 +02:00
|
|
|
font.weight: Font.DemiBold
|
|
|
|
}
|
2020-11-27 19:09:47 +01:00
|
|
|
PlasmaComponents3.Label {
|
2019-02-27 20:41:50 +01:00
|
|
|
Layout.leftMargin: theme.defaultFont.pointSize * 0.9
|
2018-06-30 17:45:03 +02:00
|
|
|
Layout.fillWidth: true
|
|
|
|
text: detailValue
|
|
|
|
elide: Text.ElideRight
|
2019-02-27 20:41:50 +01:00
|
|
|
horizontalAlignment: Qt.AlignRight
|
2018-06-30 17:45:03 +02:00
|
|
|
}
|
2017-08-29 23:58:49 +02:00
|
|
|
}
|
2018-06-30 17:45:03 +02:00
|
|
|
|
2017-10-01 17:49:48 +02:00
|
|
|
MouseArea {
|
|
|
|
acceptedButtons: Qt.RightButton
|
2018-06-30 17:45:03 +02:00
|
|
|
anchors.fill: parent
|
2017-10-01 17:49:48 +02:00
|
|
|
onClicked: {
|
|
|
|
var view = detailItem.ListView.view
|
|
|
|
var coordinates = mapToItem(view, mouseX, mouseY)
|
|
|
|
view.showContextMenu(detailItem, coordinates.x, coordinates.y)
|
|
|
|
}
|
|
|
|
}
|
2017-08-29 23:58:49 +02:00
|
|
|
}
|