on xenial help sign in
Use volume-sync action to resync the volume control. Fixes: #1520548

Approved by: Albert Astals Cid

commit641284016e2c9a2ed63cbcd626c9ac0e3ebd9630 authorNick Dedekind <nick.dedekind@canonical.com> dateTue 5 Jan 2016, 13:55 (11 years ago) parent88c6f0007b1141
1 file changed+13−1
qml/Panel/Indicators/MenuItemFactory.qml+13−1
qml/Panel/Indicators/MenuItemFactory.qml+13−1
@@ -125,10 +125,12 @@ Item {
125125 menuModel.loadExtendedAttributes(menuIndex, {'min-value': 'double',
126126 'max-value': 'double',
127127 'min-icon': 'icon',
128− 'max-icon': 'icon'});
128+ 'max-icon': 'icon',
129+ 'x-canonical-sync-action': 'string'});
129130 }
130131
131132 ServerPropertySynchroniser {
133+ id: sliderPropertySync
132134 objectName: "sync"
133135 syncTimeout: Utils.Constants.indicatorValueTimeout
134136 bufferedSyncTimeout: true
@@ -141,6 +143,16 @@ Item {
141143
142144 onSyncTriggered: menuModel.changeState(menuIndex, value)
143145 }
146+
147+ UnityMenuAction {
148+ model: menuModel
149+ index: menuIndex
150+ name: getExtendedProperty(extendedData, "xCanonicalSyncAction", "")
151+ onStateChanged: {
152+ sliderPropertySync.reset();
153+ sliderPropertySync.updateUserValue();
154+ }
155+ }
144156 }
145157 }
146158