Commit 39107ca2 authored by Thomas Hartmann's avatar Thomas Hartmann Committed by Tim Jenssen

QmlDesigner.PropertyEditor: Remove Slider from SpinBox

The integrated slider in a SpinBox did not work well.
Sliders do crash on Yosemite if maximumValue and minimumValue
are the same.

Change-Id: If1a5fe5109591bc8198c5659f10e73ebaeb8c636
Task-number: QTCREATORBUG-13842
Reviewed-by: default avatarTim Jenssen <tim.jenssen@theqtcompany.com>
parent e421b348
...@@ -39,79 +39,6 @@ SpinBox { ...@@ -39,79 +39,6 @@ SpinBox {
property color highlightColor: "orange" property color highlightColor: "orange"
property color textColor: "#eee" property color textColor: "#eee"
function showSlider() {
timer.stop()
timer2.start()
slider.opacity = 1;
}
onHoveredChanged: {
if (hovered)
showSlider();
}
Slider {
id: slider
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.bottom
height: 10;
//opacity: 0
maximumValue: spinBox.maximumValue
minimumValue: spinBox.minimumValue
value: spinBox.value
visible: false
onValueChanged: {
spinBox.value = value
}
Behavior on opacity {
PropertyAnimation {
duration: 100
}
}
onHoveredChanged: {
if (!hovered) {
timer.startTimer();
} else {
timer2.stop()
timer.stop()
}
}
}
Timer {
id: timer
repeat: false
function startTimer() {
if (!timer.running)
timer.start()
}
interval: 600
onTriggered: {
return
if (!slider.hovered)
slider.opacity = 0;
}
}
Timer {
id: timer2
repeat: false
interval: 1000
onTriggered: {
return
if (!slider.hovered)
slider.opacity = 0;
}
}
style: CustomSpinBoxStyle { style: CustomSpinBoxStyle {
} }
......
...@@ -63,25 +63,6 @@ Controls.SpinBox { ...@@ -63,25 +63,6 @@ Controls.SpinBox {
backendValue.value = value; backendValue.value = value;
} }
Controls.Slider {
id: slider
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.bottom
height: 10
visible: false
maximumValue: spinBox.maximumValue
minimumValue: spinBox.minimumValue
value: spinBox.value
onValueChanged: {
spinBox.value = value
}
}
style: CustomSpinBoxStyle { style: CustomSpinBoxStyle {
} }
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment