summaryrefslogtreecommitdiff
path: root/share/qtcreator/welcomescreen/widgets/GettingStartedItem.qml
blob: 00b4f404fb5c3184545a579e218bd3cd94f6b046 (plain)
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
import QtQuick 2.1

Item {
    id: gettingStartedItem
    width: 200
    height: 300

    property alias title: titleText.text
    property alias description: descriptionText.text
    property int number: 1
    property alias imageUrl: image.source

    signal clicked

    Rectangle {
        y: 170
        width: 20
        height: 20
        color: "#7383a7"
        radius: 20
        anchors.left: parent.left
        anchors.leftMargin: 8
        smooth: true
        visible: false

        Text {
            color: "#f7f7f7"
            font.bold: true
            text: gettingStartedItem.number
            font.family: "Helvetica"
            anchors.horizontalCenter: parent.horizontalCenter
            anchors.verticalCenter: parent.verticalCenter
            font.pixelSize: 15
        }
    }

    Text {
        id: titleText
        y: 188
        color: colors.strongForegroundColor
        wrapMode: Text.WordWrap
        anchors.left: parent.left
        anchors.leftMargin: 8
        anchors.right: parent.right
        anchors.rightMargin: 8
        font: fonts.standardCaption
    }

    Text {
        id: descriptionText
        y: 246
        height: 62
        color: "#828282"
        anchors.bottom: parent.bottom
        anchors.bottomMargin: 2
        anchors.right: parent.right
        anchors.rightMargin: 8
        anchors.left: parent.left
        anchors.leftMargin: 8
        horizontalAlignment: Text.AlignJustify
        wrapMode: Text.WordWrap
        font.pixelSize: 12
        font.bold: false
        font.family: "Helvetica"
    }

    Item {
        id: item1
        y: 22
        width: 184
        height: 160
        anchors.right: parent.right
        anchors.rightMargin: 8
        anchors.left: parent.left
        anchors.leftMargin: 8

        Image {
            id: image
            x: 0
            y: 0
            anchors.horizontalCenter: parent.horizontalCenter
            anchors.verticalCenter: parent.verticalCenter
        }
    }
    Rectangle {
        id: border
        color: "#00000000"
        radius: 8
        visible: false
        anchors.fill: parent
        border.color: "#dddcdc"
        anchors.margins: 4
    }

    MouseArea {
        anchors.fill: parent
        hoverEnabled: true
        cursorShape: Qt.PointingHandCursor
        onEntered: {
            gettingStartedItem.state="hover"
        }

        onExited: {
            gettingStartedItem.state=""
        }

        onClicked: {
            gettingStartedItem.clicked();
        }

    }

    states: [
        State {
            name: "hover"

            PropertyChanges {
                target: border
                visible: true
            }
        }
    ]
}