File: Statistics.qml

package info (click to toggle)
syncthingtray 2.0.9-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,124 kB
  • sloc: cpp: 34,081; xml: 1,705; java: 1,258; sh: 97; javascript: 54; makefile: 25
file content (59 lines) | stat: -rw-r--r-- 1,730 bytes parent folder | download
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
}