18 import Ubuntu.Components 0.1
21 height: childrenRect.height
22 width: childrenRect.width
23 property variant tooltip
25 property variant sliderData
26 property string action
27 property alias value: slider.value
35 onSliderDataChanged: {
36 label.text = sliderData[
"label"]
37 slider.minimumValue = sliderData[
"min"]
38 slider.maximumValue = sliderData[
"max"]
39 if(
"live" in sliderData)
40 slider.live = sliderData[
"live"]
43 if(
"value" in sliderData)
44 slider.value = sliderData[
"value"]
45 action = sliderData[
"action"]
50 anchors.top: parent.top
51 anchors.left: parent.left
52 anchors.right: parent.right
53 anchors.margins: units.gu(1)
54 anchors.leftMargin: units.gu(2)
59 anchors.top: label.bottom
60 anchors.left: parent.left
61 anchors.right: parent.right
62 anchors.margins: units.gu(1)
65 function realFormatValue(v) {
return Math.round(v) +
" %" }
66 function formatValue(v) {
return tooltip.target == slider ?
"" : realFormatValue(v) }
67 onPressedChanged: tooltip.target = pressed ? slider : undefined
70 source:
"graphics/divider.sci"
71 anchors.top: slider.bottom
72 anchors.left: parent.left
73 anchors.right: parent.right
74 anchors.topMargin: units.gu(2)