Changeset View
Changeset View
Standalone View
Standalone View
applet/contents/ui/ListItemBase.qml
Show First 20 Lines • Show All 179 Lines • ▼ Show 20 Line(s) | 178 | PlasmaComponents.Slider { | |||
---|---|---|---|---|---|
180 | 180 | | |||
181 | // Helper properties to allow async slider updates. | 181 | // Helper properties to allow async slider updates. | ||
182 | // While we are sliding we must not react to value updates | 182 | // While we are sliding we must not react to value updates | ||
183 | // as otherwise we can easily end up in a loop where value | 183 | // as otherwise we can easily end up in a loop where value | ||
184 | // changes trigger volume changes trigger value changes. | 184 | // changes trigger volume changes trigger value changes. | ||
185 | property int volume: Volume | 185 | property int volume: Volume | ||
186 | property bool ignoreValueChange: true | 186 | property bool ignoreValueChange: true | ||
187 | property bool forceRaiseMaxVolume: maxVolumeList.indexOf(maxVolumeTarget) != -1 | 187 | property bool forceRaiseMaxVolume: maxVolumeList.indexOf(maxVolumeTarget) != -1 | ||
188 | readonly property bool raiseMaxVolume: forceRaiseMaxVolume || volume >= PulseAudio.NormalVolume * 1.01 | 188 | readonly property int expectedValue: forceRaiseMaxVolume ? maxVolumeValue : PulseAudio.NormalVolume | ||
189 | 189 | | |||
190 | Layout.fillWidth: true | 190 | Layout.fillWidth: true | ||
191 | minimumValue: PulseAudio.MinimalVolume | 191 | minimumValue: PulseAudio.MinimalVolume | ||
192 | maximumValue: raiseMaxVolume ? PulseAudio.MaximalVolume : PulseAudio.NormalVolume | 192 | maximumValue: volume >= expectedValue * 1.01 ? PulseAudio.MaximalVolume : expectedValue | ||
193 | stepSize: maximumValue / (maximumValue / PulseAudio.NormalVolume * 100.0) | 193 | stepSize: maximumValue / (maximumValue / PulseAudio.NormalVolume * 100.0) | ||
194 | visible: HasVolume | 194 | visible: HasVolume | ||
195 | enabled: VolumeWritable | 195 | enabled: VolumeWritable | ||
196 | opacity: Muted ? 0.5 : 1 | 196 | opacity: Muted ? 0.5 : 1 | ||
197 | 197 | | |||
198 | Accessible.name: i18nc("Accessibility data on volume slider", "Adjust volume for %1", textLabel.text) | 198 | Accessible.name: i18nc("Accessibility data on volume slider", "Adjust volume for %1", textLabel.text) | ||
199 | 199 | | |||
200 | Component.onCompleted: { | 200 | Component.onCompleted: { | ||
▲ Show 20 Lines • Show All 186 Lines • Show Last 20 Lines |