Changeset View
Changeset View
Standalone View
Standalone View
src/kcm/package/contents/ui/VolumeSlider.qml
Show All 14 Lines | 1 | /* | |||
---|---|---|---|---|---|
15 | GNU General Public License for more details. | 15 | GNU General Public License for more details. | ||
16 | 16 | | |||
17 | You should have received a copy of the GNU General Public License | 17 | You should have received a copy of the GNU General Public License | ||
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | import QtQuick 2.4 | 21 | import QtQuick 2.4 | ||
22 | import QtQuick.Layouts 1.0 | 22 | import QtQuick.Layouts 1.0 | ||
23 | import QtQuick.Controls 1.0 | 23 | import QtQuick.Controls 2.0 | ||
24 | 24 | | |||
25 | import org.kde.plasma.private.volume 0.1 | 25 | import org.kde.plasma.private.volume 0.1 | ||
26 | 26 | | |||
27 | RowLayout { | 27 | RowLayout { | ||
28 | Layout.bottomMargin: hundredPercentLabel.height | 28 | Layout.bottomMargin: hundredPercentLabel.height | ||
29 | 29 | | |||
30 | Slider { | 30 | Slider { | ||
31 | id: slider | 31 | id: slider | ||
32 | 32 | | |||
33 | // Helper properties to allow async slider updates. | 33 | // Helper properties to allow async slider updates. | ||
34 | // While we are sliding we must not react to value updates | 34 | // While we are sliding we must not react to value updates | ||
35 | // as otherwise we can easily end up in a loop where value | 35 | // as otherwise we can easily end up in a loop where value | ||
36 | // changes trigger volume changes trigger value changes. | 36 | // changes trigger volume changes trigger value changes. | ||
37 | property int volume: Volume | 37 | property int volume: Volume | ||
38 | property bool ignoreValueChange: true | 38 | property bool ignoreValueChange: true | ||
39 | 39 | | |||
40 | Layout.fillWidth: true | 40 | Layout.fillWidth: true | ||
41 | minimumValue: PulseAudio.MinimalVolume | 41 | from: PulseAudio.MinimalVolume | ||
42 | maximumValue: PulseAudio.MaximalVolume | 42 | to: PulseAudio.MaximalVolume | ||
43 | visible: HasVolume | 43 | visible: HasVolume | ||
44 | enabled: VolumeWritable | 44 | enabled: VolumeWritable | ||
45 | opacity: Muted ? 0.5 : 1 | 45 | opacity: Muted ? 0.5 : 1 | ||
46 | 46 | | |||
47 | Component.onCompleted: { | 47 | Component.onCompleted: { | ||
48 | ignoreValueChange = false; | 48 | ignoreValueChange = false; | ||
49 | } | 49 | } | ||
50 | 50 | | |||
▲ Show 20 Lines • Show All 62 Lines • Show Last 20 Lines |