2023-09-11 10:20:36 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Components 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
|
|
|
|
import utils 1.0
|
|
|
|
|
|
|
|
StatusListItem {
|
|
|
|
id: root
|
|
|
|
|
|
|
|
signal itemSelected(var selectedItem)
|
|
|
|
signal itemHovered(var selectedItem, bool hovered)
|
|
|
|
|
|
|
|
QtObject {
|
|
|
|
id: d
|
|
|
|
|
|
|
|
function selectItem() {
|
|
|
|
root.itemSelected(model)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Connections {
|
|
|
|
target: root.sensor
|
|
|
|
function onContainsMouseChanged() {
|
|
|
|
root.itemHovered(model, root.sensor.containsMouse)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
title: name
|
|
|
|
statusListItemTitleAside.font.pixelSize: 15
|
|
|
|
asset.name: iconUrl ? iconUrl : ""
|
|
|
|
asset.isImage: true
|
|
|
|
asset.width: 32
|
|
|
|
asset.height: 32
|
|
|
|
statusListItemLabel.color: Theme.palette.directColor1
|
|
|
|
statusListItemInlineTagsSlot.spacing: 0
|
|
|
|
|
|
|
|
radius: sensor.containsMouse || root.highlighted ? 0 : 8
|
|
|
|
color: sensor.containsMouse || root.highlighted ? Theme.palette.baseColor2 : "transparent"
|
|
|
|
|
|
|
|
onClicked: d.selectItem()
|
|
|
|
|
2024-02-20 07:43:31 +00:00
|
|
|
property int numItems
|
|
|
|
|
2023-09-11 10:20:36 +00:00
|
|
|
components: [
|
|
|
|
StatusRoundedImage {
|
|
|
|
width: 20
|
|
|
|
height: 20
|
2023-10-30 22:18:58 +00:00
|
|
|
image.source: Style.svg("tiny/%1".arg(networkIconUrl))
|
2023-09-11 10:20:36 +00:00
|
|
|
visible: !isCollection && root.sensor.containsMouse
|
|
|
|
},
|
2024-02-20 07:43:31 +00:00
|
|
|
StatusBaseText {
|
|
|
|
id: label
|
|
|
|
text: root.numItems
|
|
|
|
font.pixelSize: 13
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
visible: isCollection
|
|
|
|
},
|
2023-09-11 10:20:36 +00:00
|
|
|
StatusIcon {
|
|
|
|
icon: "tiny/chevron-right"
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
width: 16
|
|
|
|
height: 16
|
|
|
|
visible: isCollection
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|