aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quickcontrols/wearable/Wearable/NotificationsPage.qml
blob: 30c70f4a9917527a61b36893a062bbcfdffe3392 (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
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

import QtQuick
import WearableStyle
import "notifications.js" as NotificationData


Item {
    id: notificationpage

    ListView {
        id: listview

        anchors.fill: parent
        anchors.margins: 15
        anchors.topMargin: 40 + 15
        spacing: 10
        clip: false

        model: ListModel {
            id: missedCallsList
        }

        delegate: ListHeaderItem {
            id: notificationItem

            required property string name
            required property string date
            required property string time
            required property string text

            width: parent.width
            height: 80

            Item {
                anchors.top: parent.top
                anchors.left: parent.left
                anchors.right: parent.right
                height: 25
                Text {
                    anchors.verticalCenter: parent.verticalCenter
                    anchors.left: parent.left
                    anchors.margins: 10
                    text: notificationItem.name
                    color: UIStyle.titletextColor
                    font: UIStyle.h3
                }
                Text {
                    anchors.verticalCenter: parent.verticalCenter
                    anchors.right: parent.right
                    anchors.margins: 10
                    text: notificationItem.date + " " + notificationItem.time
                    color: UIStyle.titletextColor
                    font: UIStyle.p1
                }
            }


            Text {
                anchors.fill: parent
                anchors.margins: 10
                anchors.topMargin: 30
                text: notificationItem.text
                wrapMode: Text.WordWrap
                color: UIStyle.textColor
                font: UIStyle.p1
                lineHeight: UIStyle.p1lineHeight
                lineHeightMode: Text.FixedHeight
            }
        }

        Component.onCompleted: {
            NotificationData.populateData(missedCallsList)
        }
    }
}