aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-03-13 14:22:17 +0100
committerJ-P Nurmi <jpnurmi@qt.io>2017-03-13 14:47:38 +0000
commit455b6399b3a807daf4aace28a70ecb455d74c855 (patch)
treee71d9fb5f754497f43d0787516abf338e07eb562 /examples
parent7bb9e01bec50cb87f0c4203e8350b69fb3218646 (diff)
Wearable: cleanup NotificationsPage
Change-Id: Idc8376405e113a9837fbe43fbf85681cf9ed8737 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/quickcontrols2/wearable/qml/Notifications/NotificationsPage.qml115
1 files changed, 41 insertions, 74 deletions
diff --git a/examples/quickcontrols2/wearable/qml/Notifications/NotificationsPage.qml b/examples/quickcontrols2/wearable/qml/Notifications/NotificationsPage.qml
index 24a93e48..d5bec2f8 100644
--- a/examples/quickcontrols2/wearable/qml/Notifications/NotificationsPage.qml
+++ b/examples/quickcontrols2/wearable/qml/Notifications/NotificationsPage.qml
@@ -53,92 +53,59 @@ import QtQuick.Controls 2.0 as QQC2
import "../Style"
import "notifications.js" as NotificationData
-Item {
- QQC2.SwipeView {
- id: svNotificationsContainer
+ListView {
+ id: missedCallsView
- anchors.fill: parent
+ clip: true
+ focus: true
+ boundsBehavior: Flickable.StopAtBounds
+ snapMode: ListView.SnapToItem
- Item {
- id: notificationsPage1
-
- ListModel {
- id: missedCallsList
- }
-
- Row {
- anchors.fill: parent
- leftPadding: 30
- spacing: 2
+ model: ListModel {
+ id: missedCallsList
+ }
- Image {
- id: missedCallIcon
- anchors.verticalCenter: parent.verticalCenter
- height: 64
- width: 64
- source: "images/missedcall.png"
- }
+ Image {
+ id: missedCallIcon
+ width: parent.width / 2
+ anchors.right: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+ source: "images/missedcall.png"
+ fillMode: Image.Pad
+ }
- ListView {
- id: missedCallsView
- width: parent.width - missedCallIcon.width
- height: parent.height
+ delegate: Item {
+ height: missedCallsView.height
+ width: missedCallsView.width / 2
+ anchors.left: parent.horizontalCenter
- clip: true
- focus: true
- boundsBehavior: Flickable.StopAtBounds
- snapMode: ListView.SnapToItem
+ Column {
+ spacing: 15
+ anchors.verticalCenter: parent.verticalCenter
- model: missedCallsList
+ Image {
+ anchors.horizontalCenter: parent.horizontalCenter
+ source: qsTr("images/avatar%1.png").arg(model.gender)
+ }
- delegate: Item {
- height: missedCallsView.height
- width: missedCallsView.width
- Column {
- anchors.fill: parent
- spacing: 15
- topPadding: 35
- Image {
- anchors.horizontalCenter:
- parent.horizontalCenter
- height: 64
- width: 64
- source: (gender == "m") ?
- "images/avatarm.png"
- :"images/avatarf.png"
- }
+ Text {
+ text: model.name
+ anchors.horizontalCenter: parent.horizontalCenter
+ font.bold: true
+ font.pixelSize: UIStyle.fontSizeS
+ color: UIStyle.colorQtGray1
+ }
- Text {
- anchors.horizontalCenter:
- parent.horizontalCenter
- text: name
- font.bold: true
- font.pixelSize: UIStyle.fontSizeS
- color: UIStyle.colorQtGray1
- }
- Text {
- anchors.horizontalCenter:
- parent.horizontalCenter
- text: date + " " + time
- font.pixelSize: UIStyle.fontSizeXS
- font.italic: true
- color: UIStyle.colorQtGray2
- }
- }
- }
- }
+ Text {
+ anchors.horizontalCenter: parent.horizontalCenter
+ text: date + " " + time
+ font.pixelSize: UIStyle.fontSizeXS
+ font.italic: true
+ color: UIStyle.colorQtGray2
}
}
}
- QQC2.PageIndicator {
- count: svNotificationsContainer.count
- currentIndex: svNotificationsContainer.currentIndex
-
- anchors.bottom: svNotificationsContainer.bottom
- anchors.horizontalCenter: parent.horizontalCenter
- }
-
Component.onCompleted: {
NotificationData.populateData(missedCallsList)
}