Changeset View
Changeset View
Standalone View
Standalone View
applet/contents/ui/ListItemBase.qml
Show First 20 Lines • Show All 146 Lines • ▼ Show 20 Line(s) | 134 | RowLayout { | |||
---|---|---|---|---|---|
147 | PlasmaComponents.Slider { | 147 | PlasmaComponents.Slider { | ||
148 | id: slider | 148 | id: slider | ||
149 | 149 | | |||
150 | // Helper properties to allow async slider updates. | 150 | // Helper properties to allow async slider updates. | ||
151 | // While we are sliding we must not react to value updates | 151 | // While we are sliding we must not react to value updates | ||
152 | // as otherwise we can easily end up in a loop where value | 152 | // as otherwise we can easily end up in a loop where value | ||
153 | // changes trigger volume changes trigger value changes. | 153 | // changes trigger volume changes trigger value changes. | ||
154 | property int volume: Volume | 154 | property int volume: Volume | ||
155 | property bool ignoreValueChange: false | 155 | property bool ignoreValueChange: true | ||
156 | 156 | | |||
157 | Layout.fillWidth: true | 157 | Layout.fillWidth: true | ||
158 | minimumValue: PulseAudio.MinimalVolume | 158 | minimumValue: PulseAudio.MinimalVolume | ||
159 | maximumValue: maxVolumeValue | 159 | maximumValue: maxVolumeValue | ||
160 | stepSize: maximumValue / maxVolumePercent | 160 | stepSize: maximumValue / maxVolumePercent | ||
161 | visible: HasVolume | 161 | visible: HasVolume | ||
162 | enabled: VolumeWritable | 162 | enabled: VolumeWritable | ||
163 | opacity: Muted ? 0.5 : 1 | 163 | opacity: Muted ? 0.5 : 1 | ||
164 | 164 | | |||
165 | Component.onCompleted: { | ||||
166 | ignoreValueChange = false; | ||||
167 | } | ||||
168 | | ||||
165 | onVolumeChanged: { | 169 | onVolumeChanged: { | ||
170 | var oldIgnoreValueChange = ignoreValueChange; | ||||
166 | ignoreValueChange = true; | 171 | ignoreValueChange = true; | ||
167 | value = Volume; | 172 | value = Volume; | ||
168 | ignoreValueChange = false; | 173 | ignoreValueChange = oldIgnoreValueChange; | ||
169 | } | 174 | } | ||
170 | 175 | | |||
171 | onValueChanged: { | 176 | onValueChanged: { | ||
davidedmundson: can you not just add
if (Component.status != Ready) to the top of this method
and get rid of… | |||||
No, because Component.status is not attached property and so is not accessible from there. drosca: No, because `Component.status` is not attached property and so is not accessible from there. | |||||
172 | if (!ignoreValueChange) { | 177 | if (!ignoreValueChange) { | ||
173 | Volume = value; | 178 | Volume = value; | ||
174 | Muted = value == 0; | 179 | Muted = value == 0; | ||
175 | 180 | | |||
176 | if (type == "sink") { | 181 | if (type == "sink") { | ||
177 | playFeedback(Index); | 182 | playFeedback(Index); | ||
178 | } | 183 | } | ||
179 | 184 | | |||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |
can you not just add
if (Component.status != Ready) to the top of this method
and get rid of the bool?