on xenial help sign in
Fix pulsing notification LED on unread message

Prior to this change, hasMessages never became true even when indicator-messages reported a new message. This changes the root object to Item from QtObject because it wasn't possible to create an alias to the property var. I'm not entirely sure why this solves the problem.

commit2011f63afa0695692f5c7736dd453ab173f40ce1 authorDalton Durst <dalton@ubports.com> dateThu 28 Jan 2021, 12:32 (6 years ago) parent6119aaf
1 file changed+5−7
qml/Panel/Indicators/IndicatorsLight.qml+5−7
qml/Panel/Indicators/IndicatorsLight.qml+5−7
@@ -27,7 +27,7 @@ import Wizard 0.1
2727
2828import "../../.."
2929
30−QtObject {
30+Item {
3131 id: root
3232
3333 property bool supportsMultiColorLed: true
@@ -40,7 +40,7 @@ QtObject {
4040
4141 property double batteryLevel: 0
4242 property string deviceState: ""
43− property bool hasMessages: false
43+ property alias hasMessages: _rootState.hasMessages
4444
4545 property string batteryIconName: Status.batteryIcon
4646 property string displayStatus: Powerd.status
@@ -183,15 +183,13 @@ console.log("no support for Multicolor LED. " + indicatorState)
183183 objectPath: "/com/canonical/indicator/messages"
184184 }
185185
186− property var _rootState: Indicators.ActionRootState {
186+ Indicators.ActionRootState {
187+ id: _rootState
187188 actionGroup: _actionGroup
188189 actionName: "messages"
189190 Component.onCompleted: actionGroup.start()
190191 property bool hasMessages: (String(icons).indexOf("indicator-messages-new") != -1) && valid
191− onHasMessagesChanged: {
192− root.hasMessages = hasMessages
193− updateLightState("onHasMessagesChanged")
194− }
192+ onHasMessagesChanged: updateLightState("onHasMessagesChanged")
195193 }
196194
197195 // Charging state and battery level are determined by listening to dbus signals from upower.