Ubuntu Pastebin

Paste from jgdx at Tue, 27 Oct 2015 14:41:56 +0000

Download as text
 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
import QtQuick 2.4
import Ubuntu.Components 1.3
import Ubuntu.Layouts 1.0

Base {
    id: root

    property alias  control: controlContainer.control
    property string iconName
    property url    iconSource
    property bool   iconFrame: false
    property bool   leadWithControl: false

    ListItemLayout {
        id: layout

        title.text: root.text
        title.opacity: enabled ? 1 : 0.5

        Icon {
            id: icon
            SlotsLayout.position: leadWithControl ? SlotsLayout.Trailing : SlotsLayout.Leading
            visible: (name !== "" || source.toString() !== "")
            name: root.iconName ? root.iconName : ""
            height: Math.min(units.gu(5), layout.height - units.gu(1))
            width: height
        }

        Item {
            id: controlContainer
            property Item control
            SlotsLayout.position: leadWithControl ? SlotsLayout.Leading : SlotsLayout.Trailing
            width: control ? control.width : undefined
            height: control ? control.height : undefined
            visible: control
            onControlChanged: if (control) control.parent = controlContainer
        }

        ProgressionSlot {
            visible: root.progression
        }
    }

    onIconSourceChanged: icon.source = iconSource
}
Download as text