~ubuntu-branches/ubuntu/saucy/plasma-mobile/saucy

« back to all changes in this revision

Viewing changes to applets/notifications/contents/ui/NotificationDelegate.qml

  • Committer: Package Import Robot
  • Author(s): Rohan Garg
  • Date: 2012-12-22 01:58:11 UTC
  • mfrom: (1.1.7)
  • Revision ID: package-import@ubuntu.com-20121222015811-zqq9spgc9e0gin07
Tags: 3.0-0ubuntu1
* New upstream release
* Update install files
* Run wrap-and-sort
* Add plasma-mobile-dev
* Drop plasma-active-keyboardcontainer

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
    opacity: 1-Math.abs(x)/width
28
28
    width: popupFlickable.width
29
29
 
 
30
    visible: appTabBar.currentTab == allAppsTab || appTabBar.currentTab.text == appName
 
31
 
 
32
    Component.onCompleted: {
 
33
        allApplicationsModel.addApplication(appIcon, appName)
 
34
        mainScrollArea.height = mainScrollArea.implicitHeight
 
35
    }
 
36
    Component.onDestruction: {
 
37
        allApplicationsModel.removeApplication(model.appName)
 
38
        mainScrollArea.height = mainScrollArea.implicitHeight
 
39
    }
30
40
    Timer {
31
41
        interval: 30*60*1000
32
42
        repeat: false
61
71
            NumberAnimation {
62
72
                target: notificationItem
63
73
                properties: "x"
64
 
                to: removeAnimation.exitFromRight ? notificationItem.width : -notificationItem.width
 
74
                to: removeAnimation.exitFromRight ? notificationItem.width-1 : 1-notificationItem.width
65
75
                duration: 250
66
76
                easing.type: Easing.InOutQuad
67
77
            }
91
101
            width: popupFlickable.width
92
102
            Item {
93
103
                width: parent.width
94
 
                height: appNameLabel.height
95
 
                QIconItem {
96
 
                    id: appIconItem
97
 
                    icon: QIcon(appIcon)
98
 
                    width: theme.mediumIconSize
99
 
                    height: theme.mediumIconSize
100
 
                }
 
104
                height: summaryLabel.height
101
105
 
102
106
                PlasmaComponents.Label {
103
 
                    id: appNameLabel
104
 
                    text: appName
 
107
                    id: summaryLabel
 
108
                    text: summary
105
109
                    font.bold: true
106
110
                    height: paintedHeight
107
111
                    anchors {
108
 
                        left: appIconItem.right
 
112
                        left: parent.left
109
113
                        right: parent.right
110
114
                    }
111
115
                    horizontalAlignment: Text.AlignHCenter
131
135
                }
132
136
            }
133
137
 
134
 
            PlasmaComponents.Label {
135
 
                text: body
136
 
                color: theme.textColor
137
 
                anchors {
138
 
                    left: parent.left
139
 
                    right:parent.right
140
 
                    leftMargin: theme.mediumIconSize+6
141
 
                    rightMargin: theme.mediumIconSize+6
142
 
                }
143
 
                wrapMode: Text.Wrap
 
138
            Item {
 
139
                height: childrenRect.height
 
140
                width: parent.width
 
141
                QIconItem {
 
142
                    id: appIconItem
 
143
                    icon: QIcon(appIcon)
 
144
                    width: theme.largeIconSize
 
145
                    height: theme.largeIconSize
 
146
                    visible: !imageItem.visible
 
147
                    anchors {
 
148
                        left: parent.left
 
149
                        verticalCenter: parent.verticalCenter
 
150
                    }
 
151
                }
 
152
                QImageItem {
 
153
                    id: imageItem
 
154
                    anchors.fill: appIconItem
 
155
                    image: model.image
 
156
                    smooth: true
 
157
                    visible: nativeWidth > 0
 
158
                }
 
159
                PlasmaComponents.Label {
 
160
                    text: body
 
161
                    color: theme.textColor
 
162
                    anchors {
 
163
                        left: appIconItem.right
 
164
                        right: actionsColumn.left
 
165
                        verticalCenter: parent.verticalCenter
 
166
                        leftMargin: 6
 
167
                        rightMargin: 6
 
168
                    }
 
169
                    wrapMode: Text.Wrap
 
170
                }
 
171
                Column {
 
172
                    id: actionsColumn
 
173
                    spacing: 6
 
174
                    anchors {
 
175
                        right: parent.right
 
176
                        rightMargin: 6
 
177
                        verticalCenter: parent.verticalCenter
 
178
                    }
 
179
                    Repeater {
 
180
                        model: actions
 
181
                        PlasmaComponents.Button {
 
182
                            text: model.text
 
183
                            width: theme.defaultFont.mSize.width * 8
 
184
                            height: theme.defaultFont.mSize.width * 2
 
185
                            onClicked: {
 
186
                                executeAction(source, model.id)
 
187
                                actionsColumn.visible = false
 
188
                            }
 
189
                        }
 
190
                    }
 
191
                }
144
192
            }
145
193
        }
146
194
    }