1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls.Material
import Main
ItemDelegate {
id: itemDelegate
Layout.fillWidth: true
ToolTip.visible: pressed
ToolTip.text: qsTr("%1 files, %2 dirs, ~ %3").arg(stats.files).arg(stats.dirs).arg(stats.bytesAsString)
ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
hoverEnabled: true
visible: App.connection.hasState
contentItem: RowLayout {
spacing: 15
ForkAwesomeIcon {
id: icon
Layout.alignment: Qt.AlignHCenter | Qt.AlignTop
}
ColumnLayout {
Layout.fillWidth: true
Label {
id: label
Layout.fillWidth: true
font.weight: Font.Medium
elide: Text.ElideRight
}
GridLayout {
Layout.fillWidth: true
columns: itemDelegate.width > 300 ? 6 : 2
ForkAwesomeIcon {
iconName: "file-o"
}
Label {
text: stats.files
font.weight: Font.Light
}
ForkAwesomeIcon {
iconName: "folder-o"
}
Label {
text: stats.dirs
font.weight: Font.Light
}
ForkAwesomeIcon {
iconName: "hdd-o"
}
Label {
text: stats.bytesAsString
font.weight: Font.Light
}
}
}
}
required property var stats
property alias iconName: icon.iconName
property alias labelText: label.text
}
|