on xenial help sign in
Fixes gap at top of sim-unlock/fullscreen notification (point 1.), fixes blocking overlay if underlying UnityMenuModel vanishes from DBus (point 2.). The third bullet-point of the bug-report, lockup of shell-UI, could not be reproduced. Fixes: 1308011

Approved by: Michał Sawicz

commit0230c28e17312184a3b244ebbbfbd1acc62c78c7 authorMirco Müller <mirco.mueller@ubuntu.com> dateThu 17 Jul 2014, 09:37 (12 years ago) parent32fe4547e2d4d4
4 files changed+53−14
debian/control+3−3 qml/Notifications/Notification.qml+21−7 qml/Notifications/NotificationMenuItemFactory.qml+12−3 qml/Notifications/Notifications.qml+17−1
debian/control+3−3
@@ -17,7 +17,7 @@ Build-Depends: cmake,
1717 libhud-client2-dev,
1818 libpay1-dev,
1919 libpulse-dev,
20− libqmenumodel-dev (>= 0.2.7),
20+ libqmenumodel-dev (>= 0.2.8),
2121 libqt5xmlpatterns5-dev,
2222 libunity-api-dev (>= 7.85),
2323 libunity-mir-dev,
@@ -52,7 +52,7 @@ Vcs-Browser: https://bazaar.launchpad.net/~unity-team/unity8/trunk
5252
5353Package: indicators-client
5454Architecture: amd64 armhf i386
55−Depends: qmenumodel-qml (>= 0.2.7),
55+Depends: qmenumodel-qml (>= 0.2.8),
5656 qtdeclarative5-ubuntu-ui-toolkit-plugin (>= 0.1.49) | qtdeclarative5-ubuntu-ui-toolkit-plugin-gles (>= 0.1.49),
5757 unity8 (= ${binary:Version}),
5858 ${misc:Depends},
@@ -77,7 +77,7 @@ Depends: gsettings-desktop-schemas,
7777 libcap2-bin,
7878 libglib2.0-bin,
7979 libunity-mir1 (>= 0.4),
80− qmenumodel-qml (>= 0.2.7),
80+ qmenumodel-qml (>= 0.2.8),
8181 qml-module-qtquick-xmllistmodel,
8282 qtdeclarative5-gsettings1.0,
8383 qtdeclarative5-ubuntu-settings-components (>= 0.3),
qml/Notifications/Notification.qml+21−7
@@ -36,7 +36,7 @@ Item {
3636 property var hints
3737 property var notification
3838 property color color
39− property bool fullscreen
39+ property bool fullscreen: false
4040 property int maxHeight
4141 property int margins
4242 property Gradient greenGradient : Gradient {
@@ -48,7 +48,6 @@ Item {
4848 GradientStop { position: 1.0; color: "#4d4745" }
4949 }
5050
51− fullscreen: false
5251 objectName: "background"
5352 implicitHeight: type !== Notification.PlaceHolder ? (fullscreen ? maxHeight : contentColumn.height + contentColumn.spacing * 2) : 0
5453
@@ -80,7 +79,7 @@ Item {
8079 Audio {
8180 id: sound
8281 objectName: "sound"
83− source: hints["suppress-sound"] != "" ? hints["sound-file"] : undefined
82+ source: hints["suppress-sound"] != "true" && hints["sound-file"] != undefined ? hints["sound-file"] : ""
8483 }
8584
8685 onOpacityChanged: {
@@ -159,9 +158,17 @@ Item {
159158 UnityMenuModel {
160159 id: unityMenuModel
161160
161+ property string lastNameOwner: ""
162+
162163 busName: paths.busName
163164 actions: paths.actions
164165 menuObjectPath: paths.menuObjectPath
166+ onNameOwnerChanged: {
167+ if (lastNameOwner != "" && nameOwner == "" && notification.notification != undefined) {
168+ notification.notification.close()
169+ }
170+ lastNameOwner = nameOwner
171+ }
165172 }
166173
167174 Behavior on implicitHeight {
@@ -272,14 +279,18 @@ Item {
272279 }
273280
274281 Column {
282+ id: dialogColumn
275283 objectName: "dialogListView"
276284 spacing: units.gu(2)
277285
278286 visible: count > 0
279287
280− anchors.left: parent.left; anchors.right: parent.right
281− anchors.top: fullscreen ? parent.top : undefined
282− anchors.bottom: fullscreen ? parent.bottom : undefined
288+ anchors {
289+ left: parent.left
290+ right: parent.right
291+ top: fullscreen ? parent.top : undefined
292+ bottom: fullscreen ? parent.bottom : undefined
293+ }
283294
284295 Repeater {
285296 model: unityMenuModel
@@ -287,7 +298,10 @@ Item {
287298 NotificationMenuItemFactory {
288299 id: menuItemFactory
289300
290− anchors.left: parent.left; anchors.right: parent.right
301+ anchors {
302+ left: dialogColumn.left
303+ right: dialogColumn.right
304+ }
291305
292306 menuModel: unityMenuModel
293307 menuData: model
qml/Notifications/NotificationMenuItemFactory.qml+12−3
@@ -50,7 +50,10 @@ Loader {
5050 Column {
5151 spacing: units.gu(2)
5252
53− anchors.left: parent.left; anchors.right: parent.right
53+ anchors {
54+ left: parent.left
55+ right: parent.right
56+ }
5457
5558 Component.onCompleted: {
5659 menuModel.loadExtendedAttributes(menuIndex, {"x-echo-mode-password": "bool"});
@@ -67,7 +70,10 @@ Loader {
6770
6871 // TODO using Qt.ImhNoPredictiveText here until lp #1291575 is fixed for ubuntu-ui-toolkit
6972 inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText
70− anchors.left: parent.left; anchors.right: parent.right
73+ anchors {
74+ left: parent.left
75+ right: parent.right
76+ }
7177 echoMode: checkBox.checked ? TextInput.Normal : TextInput.Password
7278 height: units.gu(5)
7379 onTextChanged: {
@@ -98,7 +104,10 @@ Loader {
98104 id: pinLock
99105
100106 Lockscreen {
101− anchors.left: parent.left; anchors.right: parent.right
107+ anchors {
108+ left: parent.left
109+ right: parent.right
110+ }
102111 height: menuFactory.maxHeight
103112 placeholderText: i18n.tr("Please enter SIM PIN")
104113 background: shell.background
qml/Notifications/Notifications.qml+17−1
@@ -36,8 +36,11 @@ ListView {
3636 filterRole: UnityNotifications.ModelInterface.RoleType
3737 filterRegExp: RegExp(UnityNotifications.Notification.SnapDecision)
3838 }
39− spacing: delegate.fullscreen ? 0 : units.gu(.5)
4039
40+ property bool topmostIsFullscreen: false
41+ spacing: topmostIsFullscreen ? 0 : units.gu(.5)
42+
43+ // FIXME: This doesn't make any sense and results in a binding loop
4144 currentIndex: (currentIndex < 1 && count > 1) ? 1 : -1
4245
4346 delegate: Notification {
@@ -61,6 +64,19 @@ ListView {
6164 // make sure there's no opacity-difference between the several
6265 // elements in a notification
6366 layer.enabled: add.running || remove.running || populate.running
67+
68+ Component.onCompleted: {
69+ if (index == 1) {
70+ notificationList.topmostIsFullscreen = fullscreen
71+ }
72+ }
73+
74+ onFullscreenChanged: {
75+ // index 1 because 0 is the PlaceHolder...
76+ if (index == 1) {
77+ notificationList.topmostIsFullscreen = fullscreen
78+ }
79+ }
6480 }
6581
6682 populate: Transition {