Commit 3bb66583 authored by DonLakeFlyer's avatar DonLakeFlyer

Better usability with touch

parent 5e9e8b81
......@@ -9,7 +9,7 @@ import QGroundControl.Palette 1.0
Rectangle {
id: _root
width: label.contentWidth + (_diameter * 2.5) + (_border * 4)
height: label.height * 2.5
height: Math.max(ScreenTools.isMobile ? ScreenTools.minTouchPixels : 0, label.height * 2.5)
radius: height /2
color: qgcPal.window
......@@ -49,31 +49,37 @@ Rectangle {
fillMode: Image.PreserveAspectFit
smooth: false
mipmap: false
color: qgcPal.text
cache: false
source: "/res/ArrowRight.svg"
}
MouseArea {
id: sliderDragArea
anchors.fill: parent
drag.target: slider
drag.axis: Drag.XAxis
drag.minimumX: _border
drag.maximumX: _maxXDrag
}
MouseArea {
id: sliderDragArea
anchors.leftMargin: -ScreenTools.defaultFontPixelWidth * 15
anchors.fill: slider
drag.target: slider
drag.axis: Drag.XAxis
drag.minimumX: _border
drag.maximumX: _maxXDrag
preventStealing: true
property real _maxXDrag: _root.width - (_diameter + _border)
property bool dragActive: drag.active
property real _dragOffset: 1
property real _maxXDrag: _root.width - (_diameter + _border)
property bool dragActive: drag.active
onPressed: {
mouse.x
}
onDragActiveChanged: {
if (!sliderDragArea.drag.active) {
if (slider.x > _maxXDrag - _border) {
_root.accept()
}
slider.x = _border
onDragActiveChanged: {
if (!sliderDragArea.drag.active) {
if (slider.x > _maxXDrag - _border) {
_root.accept()
}
slider.x = _border
}
}
}
......
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