on xenial help sign in
WIP: notifications visuals
26cc550Lukáš Tinkl
CMakeLists.txt+1−1
@@ -57,7 +57,7 @@ find_package(Qt5DBus 5.4 REQUIRED)
57find_package(Qt5Concurrent 5.4 REQUIRED)
57find_package(Qt5Concurrent 5.4 REQUIRED)
58find_package(Qt5Sql 5.4 REQUIRED)
58find_package(Qt5Sql 5.4 REQUIRED)
59
59
60−pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=14)
60+pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application>=14)
61pkg_check_modules(GEONAMES REQUIRED geonames>=0.2)
61pkg_check_modules(GEONAMES REQUIRED geonames>=0.2)
62pkg_check_modules(GIO REQUIRED gio-2.0>=2.32)
62pkg_check_modules(GIO REQUIRED gio-2.0>=2.32)
63pkg_check_modules(GLIB REQUIRED glib-2.0>=2.32)
63pkg_check_modules(GLIB REQUIRED glib-2.0>=2.32)
qml/Notifications/Notification.qml+58−69
@@ -1,5 +1,5 @@
1/*
1/*
2− * Copyright (C) 2013, 2015 Canonical, Ltd.
2+ * Copyright (C) 2013-2016 Canonical, Ltd.
3 *
3 *
4 * This program is free software; you can redistribute it and/or modify
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
5 * it under the terms of the GNU General Public License as published by
@@ -36,38 +36,37 @@ StyledItem {
36 property var type
36 property var type
37 property var hints
37 property var hints
38 property var notification
38 property var notification
39− property color color
39+ property color color: UbuntuColors.silk // TODO theme.palette.normal.overlay
40 property bool fullscreen: false
40 property bool fullscreen: false
41 property int maxHeight
41 property int maxHeight
42− property int margins
42+ property int margins: units.gu(1)
43− readonly property bool draggable: (type === Notification.SnapDecision && state === "contracted") || type === Notification.Interactive || type === Notification.Ephemeral
43+ readonly property bool draggable: (type === Notification.SnapDecision && state === "contracted") ||
44− readonly property bool darkOnBright: inverseMode || type === Notification.SnapDecision
44+ type === Notification.Interactive ||
45− readonly property color sdLightGrey: "#eaeaea"
45+ type === Notification.Ephemeral
46− readonly property real contentSpacing: units.gu(2)
47 readonly property bool canBeClosed: type === Notification.Ephemeral
46 readonly property bool canBeClosed: type === Notification.Ephemeral
47+ readonly property real defaultOpacity: 0.95
48 property bool hasMouse
48 property bool hasMouse
49− property bool inverseMode
50 property url background: ""
49 property url background: ""
51
50
52 objectName: "background"
51 objectName: "background"
53− implicitHeight: type !== Notification.PlaceHolder ? (fullscreen ? maxHeight : outterColumn.height - shapedBack.anchors.topMargin + contentSpacing * 2) : 0
52+ implicitHeight: type !== Notification.PlaceHolder ? (fullscreen ? maxHeight : outterColumn.height + margins * 2) : 0
54
53
55− color: (type === Notification.Confirmation && notificationList.useModal && !greeter.shown) || darkOnBright ? sdLightGrey : Qt.rgba(0.132, 0.117, 0.109, 0.97)
56− opacity: 1 - (x / notification.width) // FIXME: non-zero initially because of LP: #1354406 workaround, we want this to start at 0 upon creation eventually
54+ // FIXME: non-zero initially because of LP: #1354406 workaround, we want this to start at 0 upon creation eventually
55+ opacity: defaultOpacity - Math.abs(x / notification.width)
57
56
58 theme: ThemeSettings {
57 theme: ThemeSettings {
59− name: darkOnBright ? "Ubuntu.Components.Themes.Ambiance" : "Ubuntu.Components.Themes.SuruDark"
58+ name: "Ubuntu.Components.Themes.Ambiance"
60 }
59 }
61
60
62 state: {
61 state: {
63 var result = "";
62 var result = "";
64
63
65− if (type == Notification.SnapDecision) {
64+ if (type === Notification.SnapDecision) {
66− if (ListView.view.currentIndex == index) {
65+ if (ListView.view.currentIndex === index) {
67 result = "expanded";
66 result = "expanded";
68 } else {
67 } else {
69 if (ListView.view.count > 2) {
68 if (ListView.view.count > 2) {
70− if (ListView.view.currentIndex == -1 && index == 1) {
69+ if (ListView.view.currentIndex === -1 && index == 1) {
71 result = "expanded";
70 result = "expanded";
72 } else {
71 } else {
73 result = "contracted";
72 result = "contracted";
@@ -90,39 +89,30 @@ StyledItem {
90 Component.onCompleted: {
89 Component.onCompleted: {
91 // Turn on screen as needed (Powerd.Notification means the screen
90 // Turn on screen as needed (Powerd.Notification means the screen
92 // stays on for a shorter amount of time)
91 // stays on for a shorter amount of time)
93− if (type == Notification.SnapDecision) {
92+ if (type === Notification.SnapDecision) {
94 Powerd.setStatus(Powerd.On, Powerd.SnapDecision);
93 Powerd.setStatus(Powerd.On, Powerd.SnapDecision);
95− } else if (type != Notification.Confirmation) {
94+ } else if (type !== Notification.Confirmation) {
96 Powerd.setStatus(Powerd.On, Powerd.Notification);
95 Powerd.setStatus(Powerd.On, Powerd.Notification);
97 }
96 }
98
97
99 // FIXME: using onCompleted because of LP: #1354406 workaround, has to be onOpacityChanged really
98 // FIXME: using onCompleted because of LP: #1354406 workaround, has to be onOpacityChanged really
100− if (opacity == 1.0 && hints["suppress-sound"] !== "true" && sound.source !== "") {
99+ if (opacity == defaultOpacity && hints["suppress-sound"] !== "true" && sound.source !== "") {
101 sound.play();
100 sound.play();
102 }
101 }
103 }
102 }
104
103
105 Behavior on x {
104 Behavior on x {
106− id: normalXBehavior
107−
108 enabled: draggable
105 enabled: draggable
109− UbuntuNumberAnimation {
110− duration: UbuntuAnimation.FastDuration
111− easing.type: Easing.OutBounce
106+ UbuntuNumberAnimation { easing.type: Easing.OutBounce }
112− }
113 }
107 }
114
108
115 onHintsChanged: {
109 onHintsChanged: {
116− if (type === Notification.Confirmation && opacity == 1.0 && hints["suppress-sound"] !== "true" && sound.source !== "") {
110+ if (type === Notification.Confirmation && opacity == defaultOpacity && hints["suppress-sound"] !== "true" && sound.source !== "") {
117 sound.play();
111 sound.play();
118 }
112 }
119 }
113 }
120
114
121 Behavior on height {
115 Behavior on height {
122− id: normalHeightBehavior
123−
124− //enabled: menuItemFactory.progress == 1
125− enabled: true
126 UbuntuNumberAnimation {
116 UbuntuNumberAnimation {
127 duration: UbuntuAnimation.SnapDuration
117 duration: UbuntuAnimation.SnapDuration
128 }
118 }
@@ -131,7 +121,7 @@ StyledItem {
131 states:[
121 states:[
132 State {
122 State {
133 name: "contracted"
123 name: "contracted"
134− PropertyChanges {target: notification; height: units.gu(10)}
124+ PropertyChanges {target: notification; height: topRow.childrenRect.height + notification.margins * 2}
135 },
125 },
136 State {
126 State {
137 name: "expanded"
127 name: "expanded"
@@ -141,7 +131,7 @@ StyledItem {
141
131
142 clip: fullscreen ? false : true
132 clip: fullscreen ? false : true
143
133
144− visible: type != Notification.PlaceHolder
134+ visible: type !== Notification.PlaceHolder
145
135
146 UbuntuShape {
136 UbuntuShape {
147 id: shapedBack
137 id: shapedBack
@@ -149,9 +139,6 @@ StyledItem {
149 visible: !fullscreen
139 visible: !fullscreen
150 anchors {
140 anchors {
151 fill: parent
141 fill: parent
152− leftMargin: notification.margins
153− rightMargin: notification.margins
154− topMargin: type === Notification.Confirmation ? units.gu(.5) : 0
155 }
142 }
156 backgroundColor: parent.color
143 backgroundColor: parent.color
157 opacity: parent.opacity
144 opacity: parent.opacity
@@ -169,7 +156,7 @@ StyledItem {
169 }
156 }
170
157
171 onXChanged: {
158 onXChanged: {
172− if (draggable && notification.x > 0.75 * notification.width) {
159+ if (draggable && Math.abs(notification.x) > 0.75 * notification.width) {
173 notification.notification.close()
160 notification.notification.close()
174 }
161 }
175 }
162 }
@@ -212,11 +199,11 @@ StyledItem {
212
199
213 drag.target: draggable ? notification : undefined
200 drag.target: draggable ? notification : undefined
214 drag.axis: Drag.XAxis
201 drag.axis: Drag.XAxis
215− drag.minimumX: 0
202+ drag.minimumX: -notification.width
216 drag.maximumX: notification.width
203 drag.maximumX: notification.width
217
204
218 onClicked: {
205 onClicked: {
219− if (notification.type == Notification.Interactive) {
206+ if (notification.type === Notification.Interactive) {
220 notification.notification.invokeAction(actionRepeater.itemAt(0).actionId)
207 notification.notification.invokeAction(actionRepeater.itemAt(0).actionId)
221 } else if (hasMouse && canBeClosed) {
208 } else if (hasMouse && canBeClosed) {
222 notification.notification.close()
209 notification.notification.close()
@@ -225,7 +212,7 @@ StyledItem {
225 }
212 }
226 }
213 }
227 onReleased: {
214 onReleased: {
228− if (notification.x < notification.width / 2) {
215+ if (Math.abs(notification.x) < notification.width / 2) {
229 notification.x = 0
216 notification.x = 0
230 } else {
217 } else {
231 notification.x = notification.width
218 notification.x = notification.width
@@ -240,30 +227,28 @@ StyledItem {
240 left: parent.left
227 left: parent.left
241 right: parent.right
228 right: parent.right
242 top: parent.top
229 top: parent.top
243− margins: 0
230+ margins: notification.margins
244− topMargin: fullscreen ? 0 : type === Notification.Confirmation ? units.gu(1) : units.gu(2)
245 }
231 }
246
232
247− spacing: type === Notification.Confirmation ? units.gu(1) : units.gu(2)
233+ spacing: notification.margins
248
234
249 Row {
235 Row {
250 id: topRow
236 id: topRow
251
237
252− spacing: contentSpacing
238+ spacing: notification.margins
253 anchors {
239 anchors {
254 left: parent.left
240 left: parent.left
255 right: parent.right
241 right: parent.right
256− margins: contentSpacing
257 }
242 }
258
243
259 ShapedIcon {
244 ShapedIcon {
260 id: icon
245 id: icon
261
246
262 objectName: "icon"
247 objectName: "icon"
263− width: type == Notification.Ephemeral && !bodyLabel.visible ? units.gu(3) : units.gu(6)
248+ width: units.gu(6)
264 height: width
249 height: width
265− shaped: notification.hints["x-canonical-non-shaped-icon"] == "true" ? false : true
250+ shaped: notification.hints["x-canonical-non-shaped-icon"] !== "true"
266− visible: iconSource !== undefined && iconSource !== "" && type !== Notification.Confirmation
251+ visible: iconSource !== "" && type !== Notification.Confirmation
267 }
252 }
268
253
269 Column {
254 Column {
@@ -282,6 +267,8 @@ StyledItem {
282 }
267 }
283 visible: type !== Notification.Confirmation
268 visible: type !== Notification.Confirmation
284 fontSize: "medium"
269 fontSize: "medium"
270+ font.weight: Font.Light
271+ color: theme.palette.normal.backgroundSecondaryText
285 elide: Text.ElideRight
272 elide: Text.ElideRight
286 textFormat: Text.PlainText
273 textFormat: Text.PlainText
287 }
274 }
@@ -296,8 +283,10 @@ StyledItem {
296 }
283 }
297 visible: body != "" && type !== Notification.Confirmation
284 visible: body != "" && type !== Notification.Confirmation
298 fontSize: "small"
285 fontSize: "small"
286+ font.weight: Font.Light
287+ color: theme.palette.normal.backgroundTertiaryText
299 wrapMode: Text.Wrap
288 wrapMode: Text.Wrap
300− maximumLineCount: type == Notification.SnapDecision ? 12 : 2
289+ maximumLineCount: type === Notification.SnapDecision ? 12 : 2
301 elide: Text.ElideRight
290 elide: Text.ElideRight
302 textFormat: Text.PlainText
291 textFormat: Text.PlainText
303 }
292 }
@@ -315,17 +304,17 @@ StyledItem {
315 }
304 }
316
305
317 ListItem.ThinDivider {
306 ListItem.ThinDivider {
318− visible: type == Notification.SnapDecision
307+ visible: type === Notification.SnapDecision && notification.state !== "contracted"
319 }
308 }
320
309
321 ShapedIcon {
310 ShapedIcon {
322 id: centeredIcon
311 id: centeredIcon
323 objectName: "centeredIcon"
312 objectName: "centeredIcon"
324− width: units.gu(5)
313+ width: units.gu(6)
325 height: width
314 height: width
326− shaped: notification.hints["x-canonical-non-shaped-icon"] == "true" ? false : true
315+ shaped: notification.hints["x-canonical-non-shaped-icon"] !== "true"
327 fileSource: icon.fileSource
316 fileSource: icon.fileSource
328− visible: fileSource !== undefined && fileSource !== "" && type === Notification.Confirmation
317+ visible: fileSource !== "" && type === Notification.Confirmation
329 anchors.horizontalCenter: parent.horizontalCenter
318 anchors.horizontalCenter: parent.horizontalCenter
330 }
319 }
331
320
@@ -336,6 +325,8 @@ StyledItem {
336 anchors.horizontalCenter: parent.horizontalCenter
325 anchors.horizontalCenter: parent.horizontalCenter
337 visible: type === Notification.Confirmation && body !== ""
326 visible: type === Notification.Confirmation && body !== ""
338 fontSize: "medium"
327 fontSize: "medium"
328+ font.weight: Font.Light
329+ color: theme.palette.normal.backgroundSecondaryText
339 wrapMode: Text.WordWrap
330 wrapMode: Text.WordWrap
340 maximumLineCount: 1
331 maximumLineCount: 1
341 elide: Text.ElideRight
332 elide: Text.ElideRight
@@ -351,7 +342,6 @@ StyledItem {
351 anchors {
342 anchors {
352 left: parent.left
343 left: parent.left
353 right: parent.right
344 right: parent.right
354− margins: contentSpacing
355 }
345 }
356
346
357 height: units.gu(1)
347 height: units.gu(1)
@@ -364,7 +354,7 @@ StyledItem {
364 objectName: "innerBar"
354 objectName: "innerBar"
365 width: valueIndicator.width * valueIndicator.value / 100
355 width: valueIndicator.width * valueIndicator.value / 100
366 height: units.gu(1)
356 height: units.gu(1)
367− backgroundColor: notification.hints["x-canonical-value-bar-tint"] === "true" ? theme.palette.normal.activity : theme.palette.highlighted.foreground
357+ backgroundColor: notification.hints["x-canonical-value-bar-tint"] === "true" ? theme.palette.highlighted.activity : theme.palette.normal.activity
368 aspect: UbuntuShape.Flat
358 aspect: UbuntuShape.Flat
369 radius: "small"
359 radius: "small"
370 }
360 }
@@ -373,7 +363,7 @@ StyledItem {
373 Column {
363 Column {
374 id: dialogColumn
364 id: dialogColumn
375 objectName: "dialogListView"
365 objectName: "dialogListView"
376− spacing: units.gu(2)
366+ spacing: notification.margins
377
367
378 visible: count > 0
368 visible: count > 0
379
369
@@ -417,12 +407,11 @@ StyledItem {
417 anchors {
407 anchors {
418 left: parent.left
408 left: parent.left
419 right: parent.right
409 right: parent.right
420− margins: contentSpacing
421 }
410 }
422
411
423− spacing: contentSpacing
412+ spacing: notification.margins
424
413
425− visible: notification.type === Notification.SnapDecision && oneOverTwoRepeaterTop.count === 3
414+ visible: notification.type === Notification.SnapDecision && oneOverTwoRepeaterTop.count === 3 && notification.state === "expanded"
426
415
427 Repeater {
416 Repeater {
428 id: oneOverTwoRepeaterTop
417 id: oneOverTwoRepeaterTop
@@ -441,7 +430,8 @@ StyledItem {
441 objectName: "notify_oot_button" + index
430 objectName: "notify_oot_button" + index
442 width: oneOverTwoCase.width
431 width: oneOverTwoCase.width
443 text: oneOverTwoLoaderTop.actionLabel
432 text: oneOverTwoLoaderTop.actionLabel
444− color: notification.hints["x-canonical-private-affirmative-tint"] == "true" ? UbuntuColors.green : theme.palette.normal.baseText
433+ color: notification.hints["x-canonical-private-affirmative-tint"] === "true" ? theme.palette.normal.positive
434+ : theme.palette.normal.baseText
445 onClicked: notification.notification.invokeAction(oneOverTwoLoaderTop.actionId)
435 onClicked: notification.notification.invokeAction(oneOverTwoLoaderTop.actionId)
446 }
436 }
447 }
437 }
@@ -450,7 +440,7 @@ StyledItem {
450 }
440 }
451
441
452 Row {
442 Row {
453− spacing: contentSpacing
443+ spacing: notification.margins
454
444
455 Repeater {
445 Repeater {
456 id: oneOverTwoRepeaterBottom
446 id: oneOverTwoRepeaterBottom
@@ -469,7 +459,8 @@ StyledItem {
469 objectName: "notify_oot_button" + index
459 objectName: "notify_oot_button" + index
470 width: oneOverTwoCase.width / 2 - spacing * 2
460 width: oneOverTwoCase.width / 2 - spacing * 2
471 text: oneOverTwoLoaderBottom.actionLabel
461 text: oneOverTwoLoaderBottom.actionLabel
472− color: index == 1 && notification.hints["x-canonical-private-rejection-tint"] == "true" ? UbuntuColors.red : theme.palette.normal.baseText
462+ color: index == 1 && notification.hints["x-canonical-private-rejection-tint"] === "true" ? theme.palette.normal.negative
463+ : theme.palette.normal.baseText
473 onClicked: notification.notification.invokeAction(oneOverTwoLoaderBottom.actionId)
464 onClicked: notification.notification.invokeAction(oneOverTwoLoaderBottom.actionId)
474 }
465 }
475 }
466 }
@@ -486,10 +477,9 @@ StyledItem {
486 anchors {
477 anchors {
487 left: parent.left
478 left: parent.left
488 right: parent.right
479 right: parent.right
489− margins: contentSpacing
490 }
480 }
491− visible: notification.type === Notification.SnapDecision && actionRepeater.count > 0 && !oneOverTwoCase.visible
481+ visible: notification.type === Notification.SnapDecision && actionRepeater.count > 0 && !oneOverTwoCase.visible && notification.state === "expanded"
492− spacing: contentSpacing
482+ spacing: notification.margins
493 layoutDirection: Qt.RightToLeft
483 layoutDirection: Qt.RightToLeft
494
484
495 Loader {
485 Loader {
@@ -531,11 +521,11 @@ StyledItem {
531 text: loader.actionLabel
521 text: loader.actionLabel
532 color: {
522 color: {
533 var result = theme.palette.normal.baseText;
523 var result = theme.palette.normal.baseText;
534− if (index == 0 && notification.hints["x-canonical-private-affirmative-tint"] == "true") {
524+ if (index == 0 && notification.hints["x-canonical-private-affirmative-tint"] === "true") {
535− result = UbuntuColors.green;
525+ result = theme.palette.normal.positive;
536 }
526 }
537− if (index == 1 && notification.hints["x-canonical-private-rejection-tint"] == "true") {
527+ if (index == 1 && notification.hints["x-canonical-private-rejection-tint"] === "true") {
538− result = UbuntuColors.red;
528+ result = theme.palette.normal.negative;
539 }
529 }
540 return result;
530 return result;
541 }
531 }
@@ -554,10 +544,9 @@ StyledItem {
554 anchors {
544 anchors {
555 left: parent.left
545 left: parent.left
556 right: parent.right
546 right: parent.right
557− margins: contentSpacing
558 }
547 }
559
548
560− visible: notification.type == Notification.SnapDecision && actionRepeater.count > 3 && !oneOverTwoCase.visible
549+ visible: notification.type === Notification.SnapDecision && actionRepeater.count > 3 && !oneOverTwoCase.visible && notification.state === "expanded"
561 model: notification.actions
550 model: notification.actions
562 expanded: false
551 expanded: false
563 startIndex: 2
552 startIndex: 2
qml/Notifications/NotificationMenuItemFactory.qml+5−11
@@ -1,5 +1,5 @@
1/*
1/*
2− * Copyright 2013 Canonical Ltd.
2+ * Copyright 2013-2016 Canonical Ltd.
3 *
3 *
4 * This program is free software; you can redistribute it and/or modify
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
5 * it under the terms of the GNU Lesser General Public License as published by
@@ -12,9 +12,6 @@
12 *
12 *
13 * You should have received a copy of the GNU Lesser General Public License
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15− *
16− * Authors:
17− * Nick Dedekind <nick.dedekind@canonical.com>
18 */
15 */
19
16
20import QtQuick 2.4
17import QtQuick 2.4
@@ -71,7 +68,7 @@ Loader {
71 id: textfield
68 id: textfield
72
69
73 Column {
70 Column {
74− spacing: units.gu(2)
71+ spacing: notification.margins
75
72
76 anchors {
73 anchors {
77 left: parent.left
74 left: parent.left
@@ -87,12 +84,10 @@ Loader {
87
84
88 Label {
85 Label {
89 text: menuData.label
86 text: menuData.label
90− color: notification.sdFontColor
87+ color: theme.palette.normal.backgroundSecondaryText
91 }
88 }
92
89
93 TextField {
90 TextField {
94− id: textfield
95−
96 // TODO using Qt.ImhNoPredictiveText here until lp #1291575 is fixed for ubuntu-ui-toolkit
91 // TODO using Qt.ImhNoPredictiveText here until lp #1291575 is fixed for ubuntu-ui-toolkit
97 inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText
92 inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText
98 anchors {
93 anchors {
@@ -115,7 +110,7 @@ Loader {
115 Row {
110 Row {
116 id: checkBoxRow
111 id: checkBoxRow
117
112
118− spacing: units.gu(.5)
113+ spacing: notification.margins
119
114
120 CheckBox {
115 CheckBox {
121 id: checkBox
116 id: checkBox
@@ -127,7 +122,7 @@ Loader {
127 Label {
122 Label {
128 anchors.verticalCenter: checkBox.verticalCenter
123 anchors.verticalCenter: checkBox.verticalCenter
129 text: i18n.tr("Show password")
124 text: i18n.tr("Show password")
130− color: notification.sdFontColor
125+ color: theme.palette.normal.backgroundSecondaryText
131
126
132 MouseArea {
127 MouseArea {
133 anchors.fill: parent
128 anchors.fill: parent
@@ -151,7 +146,6 @@ Loader {
151 errorText: errorAction.valid ? errorAction.state : ""
146 errorText: errorAction.valid ? errorAction.state : ""
152 retryText: notification.body
147 retryText: notification.body
153 background: menuFactory.background
148 background: menuFactory.background
154− darkenBackground: 0.4
155
149
156 onEntered: {
150 onEntered: {
157 menuModel.changeState(menuIndex, passphrase);
151 menuModel.changeState(menuIndex, passphrase);
qml/Notifications/Notifications.qml+2−4
@@ -1,5 +1,5 @@
1/*
1/*
2− * Copyright (C) 2013 Canonical, Ltd.
2+ * Copyright (C) 2013-2016 Canonical, Ltd.
3 *
3 *
4 * This program is free software; you can redistribute it and/or modify
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
5 * it under the terms of the GNU General Public License as published by
@@ -29,7 +29,6 @@ ListView {
29 property real margin
29 property real margin
30 property bool useModal: snapDecisionProxyModel.count > 0
30 property bool useModal: snapDecisionProxyModel.count > 0
31 property bool hasMouse
31 property bool hasMouse
32− property bool inverseMode
33 property url background: ""
32 property url background: ""
34
33
35 UnitySortFilterProxyModel {
34 UnitySortFilterProxyModel {
@@ -42,7 +41,7 @@ ListView {
42 }
41 }
43
42
44 property bool topmostIsFullscreen: false
43 property bool topmostIsFullscreen: false
45− spacing: topmostIsFullscreen ? 0 : units.gu(.5)
44+ spacing: topmostIsFullscreen ? 0 : units.gu(1)
46
45
47 currentIndex: count > 1 ? 1 : -1
46 currentIndex: count > 1 ? 1 : -1
48
47
@@ -62,7 +61,6 @@ ListView {
62 maxHeight: notificationList.height
61 maxHeight: notificationList.height
63 margins: notificationList.margin
62 margins: notificationList.margin
64 hasMouse: notificationList.hasMouse
63 hasMouse: notificationList.hasMouse
65− inverseMode: notificationList.inverseMode
66 background: notificationList.background
64 background: notificationList.background
67
65
68 // make sure there's no opacity-difference between the several
66 // make sure there's no opacity-difference between the several
qml/Notifications/OptionToggle.qml+5−4
@@ -1,5 +1,5 @@
1/*
1/*
2− * Copyright (C) 2014,2015 Canonical, Ltd.
2+ * Copyright (C) 2014-2016 Canonical, Ltd.
3 *
3 *
4 * This program is free software; you can redistribute it and/or modify
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
5 * it under the terms of the GNU General Public License as published by
@@ -75,7 +75,7 @@ UbuntuShape {
75 id: delegateIcon
75 id: delegateIcon
76 anchors {
76 anchors {
77 left: parent.left
77 left: parent.left
78− leftMargin: units.gu(2)
78+ leftMargin: units.gu(1)
79 verticalCenter: parent.verticalCenter
79 verticalCenter: parent.verticalCenter
80 }
80 }
81 visible: index !== startIndex
81 visible: index !== startIndex
@@ -90,7 +90,7 @@ UbuntuShape {
90 left: delegateIcon.visible ? delegateIcon.right : parent.left
90 left: delegateIcon.visible ? delegateIcon.right : parent.left
91 leftMargin: delegateIcon.visible ? units.gu(1) : units.gu(2)
91 leftMargin: delegateIcon.visible ? units.gu(1) : units.gu(2)
92 right: parent.right
92 right: parent.right
93− rightMargin: units.gu(2)
93+ rightMargin: units.gu(1)
94 verticalCenter: delegateIcon.visible ? delegateIcon.verticalCenter : parent.verticalCenter
94 verticalCenter: delegateIcon.visible ? delegateIcon.verticalCenter : parent.verticalCenter
95 }
95 }
96
96
@@ -98,6 +98,7 @@ UbuntuShape {
98 text: splitLabel[3]
98 text: splitLabel[3]
99 color: theme.palette.normal.backgroundText
99 color: theme.palette.normal.backgroundText
100 fontSize: "small"
100 fontSize: "small"
101+ font.weight: Font.Light
101 maximumLineCount: 1
102 maximumLineCount: 1
102 elide: Text.ElideRight
103 elide: Text.ElideRight
103 }
104 }
@@ -105,7 +106,7 @@ UbuntuShape {
105 Icon {
106 Icon {
106 anchors {
107 anchors {
107 right: parent.right
108 right: parent.right
108− rightMargin: units.gu(2)
109+ rightMargin: units.gu(1)
109 verticalCenter: delegateIcon.verticalCenter
110 verticalCenter: delegateIcon.verticalCenter
110 }
111 }
111
112
qml/Notifications/SwipeToAct.qml+7−7
@@ -35,9 +35,9 @@ Item {
35
35
36 property double opacityDelta
36 property double opacityDelta
37 readonly property double sliderHeight: units.gu(8)
37 readonly property double sliderHeight: units.gu(8)
38− readonly property double gap: units.gu(1)
38+ readonly property double gap: units.gu(0.5)
39− readonly property color sliderMainColor: "#b2b2b2"
39+ readonly property color sliderMainColor: theme.palette.normal.base
40− readonly property color sliderBGColor: "#f4f4f4"
40+ readonly property color sliderBGColor: theme.palette.normal.foreground
41 readonly property double halfWay: mouseArea.drag.maximumX / 2
41 readonly property double halfWay: mouseArea.drag.maximumX / 2
42
42
43 UbuntuNumberAnimation on opacityDelta {
43 UbuntuNumberAnimation on opacityDelta {
@@ -74,7 +74,7 @@ Item {
74 iconName: leftIconName
74 iconName: leftIconName
75 visible: clickToAct
75 visible: clickToAct
76 width: (parent.width / 2) - priv.gap
76 width: (parent.width / 2) - priv.gap
77− color: UbuntuColors.red
77+ color: theme.palette.normal.negative
78 onClicked: {
78 onClicked: {
79 leftTriggered()
79 leftTriggered()
80 }
80 }
@@ -88,7 +88,7 @@ Item {
88 iconName: rightIconName
88 iconName: rightIconName
89 visible: clickToAct
89 visible: clickToAct
90 width: (parent.width / 2) - priv.gap
90 width: (parent.width / 2) - priv.gap
91− color: UbuntuColors.green
91+ color: theme.palette.normal.positive
92 onClicked: {
92 onClicked: {
93 rightTriggered()
93 rightTriggered()
94 }
94 }
@@ -108,7 +108,7 @@ Item {
108 anchors.top: parent.top
108 anchors.top: parent.top
109 anchors.left: parent.left
109 anchors.left: parent.left
110 anchors.margins: priv.gap
110 anchors.margins: priv.gap
111− backgroundColor: UbuntuColors.red
111+ backgroundColor: theme.palette.normal.negative
112 aspect: UbuntuShape.Flat
112 aspect: UbuntuShape.Flat
113
113
114 state: "normal"
114 state: "normal"
@@ -226,7 +226,7 @@ Item {
226 anchors.top: parent.top
226 anchors.top: parent.top
227 anchors.right: parent.right
227 anchors.right: parent.right
228 anchors.margins: priv.gap
228 anchors.margins: priv.gap
229− backgroundColor: UbuntuColors.green
229+ backgroundColor: theme.palette.normal.positive
230 aspect: UbuntuShape.Flat
230 aspect: UbuntuShape.Flat
231
231
232 state: "normal"
232 state: "normal"
qml/Shell.qml−14
@@ -627,26 +627,12 @@ Item {
627 onActiveChanged: unlockWhenDoneWithWizard()
627 onActiveChanged: unlockWhenDoneWithWizard()
628 }
628 }
629
629
630− Rectangle {
631− id: modalNotificationBackground
632−
633− visible: notifications.useModal
634− color: "#000000"
635− anchors.fill: parent
636− opacity: 0.9
637−
638− MouseArea {
639− anchors.fill: parent
640− }
641− }
642−
643 Notifications {
630 Notifications {
644 id: notifications
631 id: notifications
645
632
646 model: NotificationBackend.Model
633 model: NotificationBackend.Model
647 margin: units.gu(1)
634 margin: units.gu(1)
648 hasMouse: shell.hasMouse
635 hasMouse: shell.hasMouse
649− inverseMode: panel.indicators.shown
650 background: wallpaperResolver.background
636 background: wallpaperResolver.background
651
637
652 y: topmostIsFullscreen ? 0 : panel.panelHeight
638 y: topmostIsFullscreen ? 0 : panel.panelHeight
tests/qmltests/Notifications/tst_Notifications.qml+1−12
@@ -186,9 +186,9 @@ Item {
186 margin: units.gu(1)
186 margin: units.gu(1)
187
187
188 anchors.fill: parent
188 anchors.fill: parent
189+ anchors.margins: units.gu(1)
189 model: mockModel
190 model: mockModel
190 hasMouse: fakeMouseCB.checked
191 hasMouse: fakeMouseCB.checked
191− inverseMode: inverseModeCB.checked
192 }
192 }
193 }
193 }
194
194
@@ -268,17 +268,6 @@ Item {
268 anchors.verticalCenter: parent.verticalCenter
268 anchors.verticalCenter: parent.verticalCenter
269 }
269 }
270 }
270 }
271−
272− RowLayout {
273− Layout.fillWidth: true
274− CheckBox {
275− id: inverseModeCB
276− }
277− Label {
278− text: "Inverse mode"
279− anchors.verticalCenter: parent.verticalCenter
280− }
281− }
282 }
271 }
283 }
272 }
284
273
tests/qmltests/Notifications/tst_OptionToggle.qml+2−1
@@ -96,7 +96,7 @@ Row {
96
96
97 width: units.gu(40)
97 width: units.gu(40)
98 height: units.gu(81)
98 height: units.gu(81)
99− color: "#cccccc"
99+ color: theme.palette.normal.background
100
100
101 MouseArea{
101 MouseArea{
102 id: clickThroughCatcher
102 id: clickThroughCatcher
@@ -110,6 +110,7 @@ Row {
110 margin: units.gu(1)
110 margin: units.gu(1)
111
111
112 anchors.fill: parent
112 anchors.fill: parent
113+ anchors.margins: units.gu(1)
113 model: mockModel
114 model: mockModel
114 }
115 }
115 }
116 }
tests/qmltests/Notifications/tst_SwipeToAct.qml+1
@@ -110,6 +110,7 @@ Item {
110 margin: units.gu(1)
110 margin: units.gu(1)
111
111
112 anchors.fill: parent
112 anchors.fill: parent
113+ anchors.margins: units.gu(1)
113 model: mockModel
114 model: mockModel
114 hasMouse: false
115 hasMouse: false
115 }
116 }