Commit 2343f3db authored by Aleksi Suomalainen's avatar Aleksi Suomalainen

[notifications] Notifications view now flickable vertically and items are dynamically sized.

parent ed68e92c
...@@ -28,11 +28,15 @@ import QtQuick.Controls.Nemo 1.0 ...@@ -28,11 +28,15 @@ import QtQuick.Controls.Nemo 1.0
import QtQuick.Controls.Styles.Nemo 1.0 import QtQuick.Controls.Styles.Nemo 1.0
// Feeds page: // Feeds page:
// the place for an event feed. // the place for an event feed.
Flickable {
id: mainFlickable
Item { contentHeight: rootitem.height
contentWidth: parent.width
Item {
id: rootitem id: rootitem
Column { width: parent.width
spacing: 40 height: childrenRect.height
// Day of week // Day of week
Row { Row {
id: daterow id: daterow
...@@ -67,18 +71,19 @@ Item { ...@@ -67,18 +71,19 @@ Item {
} }
Column { Column {
id: notificationColumn
anchors.top: daterow.bottom anchors.top: daterow.bottom
spacing: 40 anchors.topMargin: 20
spacing: 10
Repeater { Repeater {
model: NotificationListModel { model: NotificationListModel {
id: notifmodel id: notifmodel
} }
delegate: Row { delegate:
spacing: 16
height: 40
width: rootitem.width
MouseArea { MouseArea {
anchors.fill: parent height: Math.max(appSummary.height,appBody.height)
width: rootitem.width
onClicked: { onClicked: {
if (modelData.userRemovable) { if (modelData.userRemovable) {
modelData.actionInvoked("default") modelData.actionInvoked("default")
...@@ -88,8 +93,8 @@ Item { ...@@ -88,8 +93,8 @@ Item {
Image { Image {
id: appIcon id: appIcon
source: { source: {
if (modelData.appIcon) if (modelData.icon)
return "image://theme/" + modelData.appIcon return "image://theme/" + modelData.icon
else else
return "" return ""
} }
...@@ -98,13 +103,14 @@ Item { ...@@ -98,13 +103,14 @@ Item {
Label { Label {
id: appSummary id: appSummary
text: modelData.summary text: modelData.summary
width: rootitem.width/2 width: (rootitem.width-appIcon.width)/2
font.pointSize: 10 font.pointSize: 10
anchors.left: appIcon.right anchors.left: appIcon.right
wrapMode: Text.Wrap wrapMode: Text.Wrap
} }
Label { Label {
width: rootitem.width/2 id: appBody
width: (rootitem.width-appIcon.width)/2
text: modelData.body text: modelData.body
font.pointSize: 8 font.pointSize: 8
wrapMode: Text.Wrap wrapMode: Text.Wrap
...@@ -114,5 +120,5 @@ Item { ...@@ -114,5 +120,5 @@ Item {
} }
} }
} }
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment