Changeset View
Changeset View
Standalone View
Standalone View
applet/contents/ui/ListItemBase.qml
Show First 20 Lines • Show All 166 Lines • ▼ Show 20 Line(s) | 163 | onVolumeChanged: { | |||
---|---|---|---|---|---|
167 | ignoreValueChange = oldIgnoreValueChange; | 167 | ignoreValueChange = oldIgnoreValueChange; | ||
168 | } | 168 | } | ||
169 | 169 | | |||
170 | onValueChanged: { | 170 | onValueChanged: { | ||
171 | if (!ignoreValueChange) { | 171 | if (!ignoreValueChange) { | ||
172 | Volume = value; | 172 | Volume = value; | ||
173 | Muted = value == 0; | 173 | Muted = value == 0; | ||
174 | 174 | | |||
175 | if (type == "sink") { | | |||
176 | playFeedback(Index); | | |||
177 | } | | |||
178 | | ||||
179 | if (!pressed) { | 175 | if (!pressed) { | ||
180 | updateTimer.restart(); | 176 | updateTimer.restart(); | ||
181 | } | 177 | } | ||
182 | } | 178 | } | ||
183 | } | 179 | } | ||
184 | 180 | | |||
185 | onPressedChanged: { | 181 | onPressedChanged: { | ||
186 | if (!pressed) { | 182 | if (!pressed) { | ||
187 | // Make sure to sync the volume once the button was | 183 | // Make sure to sync the volume once the button was | ||
188 | // released. | 184 | // released. | ||
189 | // Otherwise it might be that the slider is at v10 | 185 | // Otherwise it might be that the slider is at v10 | ||
190 | // whereas PA rejected the volume change and is | 186 | // whereas PA rejected the volume change and is | ||
191 | // still at v15 (e.g.). | 187 | // still at v15 (e.g.). | ||
192 | updateTimer.restart(); | 188 | updateTimer.restart(); | ||
189 | | ||||
190 | if (type == "sink") { | ||||
191 | playFeedback(Index); | ||||
192 | } | ||||
193 | } | 193 | } | ||
194 | } | 194 | } | ||
195 | 195 | | |||
196 | Timer { | 196 | Timer { | ||
197 | id: updateTimer | 197 | id: updateTimer | ||
198 | interval: 200 | 198 | interval: 200 | ||
199 | onTriggered: slider.value = Volume | 199 | onTriggered: slider.value = Volume | ||
200 | } | 200 | } | ||
▲ Show 20 Lines • Show All 193 Lines • Show Last 20 Lines |