~ci-train-bot/ubuntu-settings-components/ubuntu-settings-components-ubuntu-zesty-2106

« back to all changes in this revision

Viewing changes to Ubuntu/Settings/Menus/SliderMenu.qml

  • Committer: CI bot
  • Author(s): daker
  • Date: 2014-05-02 13:50:25 UTC
  • mfrom: (60.1.8 fix.slider)
  • Revision ID: ps-jenkins@lists.canonical.com-20140502135025-p8e3ilbh7l08emjt
Use Button instead of Image to avoid the MouseArea
Made Min/Max buttons clickable 

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
    property alias live: slider.live
29
29
    property double value: 0.0
30
30
 
31
 
    property alias minIcon: leftImage.source
32
 
    property alias maxIcon: rightImage.source
 
31
    property alias minIcon: leftButton.iconSource
 
32
    property alias maxIcon: rightButton.iconSource
33
33
 
34
34
    signal updated(real value)
35
35
 
125
125
            }
126
126
            height: slider.height
127
127
 
128
 
            Image {
129
 
                id: leftImage
130
 
                visible: status === Image.Ready
 
128
            Button {
 
129
                id: leftButton
 
130
                objectName: "leftButton"
 
131
                visible: iconSource !== ""
131
132
                anchors.left: row.left
132
133
                anchors.verticalCenter: row.verticalCenter
133
134
                height: slider.height - units.gu(2)
134
135
                width: height
 
136
                color: "transparent"
 
137
 
 
138
                onClicked: slider.value = slider.minimumValue
135
139
            }
136
140
 
137
141
            Slider {
138
142
                id: slider
139
143
                objectName: "slider"
140
144
                anchors {
141
 
                    left: leftImage.visible ? leftImage.right : row.left
142
 
                    right: rightImage.visible ? rightImage.left : row.right
143
 
                    leftMargin: leftImage.visible ? units.gu(0.5) : 0
144
 
                    rightMargin: rightImage.visible ? units.gu(0.5) : 0
 
145
                    left: leftButton.visible ? leftButton.right : row.left
 
146
                    right: rightButton.visible ? rightButton.left : row.right
 
147
                    leftMargin: leftButton.visible ? units.gu(0.5) : 0
 
148
                    rightMargin: rightButton.visible ? units.gu(0.5) : 0
145
149
                }
146
150
                live: true
147
151
 
173
177
                }
174
178
            }
175
179
 
176
 
            Image {
177
 
                id: rightImage
178
 
                visible: status === Image.Ready
 
180
            Button {
 
181
                id: rightButton
 
182
                objectName: "rightButton"
 
183
                visible: iconSource !== ""
179
184
                anchors.right: row.right
180
185
                anchors.verticalCenter: row.verticalCenter
181
186
                height: slider.height - units.gu(2)
182
187
                width: height
 
188
                color: "transparent"
 
189
 
 
190
                onClicked: slider.value =  slider.maximumValue
183
191
            }
184
192
        }
185
193
    }