~ci-train-bot/ubuntu-settings-components/ubuntu-settings-components-ubuntu-zesty-2104

75.2.2 by Nick Dedekind
more visual tweaks
1
/*
2
* Copyright 2014 Canonical Ltd.
3
*
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU Lesser General Public License as published by
6
* the Free Software Foundation; version 3.
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
* GNU Lesser General Public License for more details.
12
*
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
*
16
* Authored by Andrea Cimitan <andrea.cimitan@canonical.com>
17
*/
18
103.1.1 by Albert Astals Cid
Standarize QtQuick and Ubuntu.Components.Listitems imports
19
import QtQuick 2.4
89.1.2 by Daniel d'Andrada
Moving everything to Ubuntu.Components 1.3
20
import Ubuntu.Components 1.3
75.2.2 by Nick Dedekind
more visual tweaks
21
import Ubuntu.Settings.Components 0.1
22
import Ubuntu.Settings.Menus 0.1
23
24
Item {
146.4.10 by Marco Trevisan (Treviño)
examples: add a page action to switch between pointer and touch mode
25
    id: page
75.2.2 by Nick Dedekind
more visual tweaks
26
    property string title: "Transfer Components"
146.4.10 by Marco Trevisan (Treviño)
examples: add a page action to switch between pointer and touch mode
27
    property bool pointerMode: false
75.2.2 by Nick Dedekind
more visual tweaks
28
75.2.21 by Nick Dedekind
few tweaks
29
    width: units.gu(42)
30
    height: units.gu(75)
31
75.2.2 by Nick Dedekind
more visual tweaks
32
    ListModel {
33
        id: model
34
        ListElement {
35
            text: "File name here"
36
            state: "Starting…"
37
            progress: 0
38
            image: "image://theme/video-x-generic-symbolic"
39
            active: true
40
        }
41
        ListElement {
42
            text: "proposition.pdf"
43
            state: "10 seconds remaining"
44
            progress: 0.7
45
            image: "../tests/artwork/the-man-machine.jpg"
46
            active: true
47
        }
48
        ListElement {
49
            text: "electric.jpg"
50
            state: "Failed, tap to retry"
51
            progress: 1.0
52
            image: "../tests/artwork/electric.jpg"
53
            active: true
54
        }
55
        ListElement {
56
            text: "clubbing-friday.jpg.jpg"
57
            state: "no state"
58
            progress: 0.4
59
            image: "../tests/artwork/speak-now.jpg"
60
            active: false
61
        }
62
    }
63
64
    ListView {
65
        model: model
66
        anchors.fill: parent
67
68
        cacheBuffer: 10000
69
70
        delegate: Loader {
71
            anchors {
72
                left: parent.left
73
                right: parent.right
74
            }
75
            asynchronous: true
76
77
            sourceComponent: TransferMenu {
78
                text: model.text
79
                stateText: model.state
80
                progress: model.progress
81
                iconSource: model.image
82
                active: model.active
146.4.10 by Marco Trevisan (Treviño)
examples: add a page action to switch between pointer and touch mode
83
                pointerMode: page.pointerMode
75.2.2 by Nick Dedekind
more visual tweaks
84
            }
85
        }
86
    }
87
}