Browse Source

ActuatorSlider: hide (blue) indicator bar while not active

Particularly useful for servos, so it's clear which ones are controlled.
QGC4.4
Beat Küng 3 years ago committed by Daniel Agar
parent
commit
c05428b273
  1. 1
      src/AutoPilotPlugins/PX4/ActuatorSlider.qml
  2. 2
      src/QmlControls/QGCSlider.qml

1
src/AutoPilotPlugins/PX4/ActuatorSlider.qml

@ -44,6 +44,7 @@ Column {
updateValueWhileDragging: true updateValueWhileDragging: true
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
height: ScreenTools.defaultFontPixelHeight * _sliderHeight height: ScreenTools.defaultFontPixelHeight * _sliderHeight
indicatorBarVisible: sendTimer.running
onValueChanged: { onValueChanged: {
if (blockUpdates) if (blockUpdates)

2
src/QmlControls/QGCSlider.qml

@ -22,6 +22,7 @@ Slider {
// Value indicator starts display from zero instead of min value // Value indicator starts display from zero instead of min value
property bool zeroCentered: false property bool zeroCentered: false
property bool displayValue: false property bool displayValue: false
property bool indicatorBarVisible: true
style: SliderStyle { style: SliderStyle {
groove: Item { groove: Item {
@ -40,6 +41,7 @@ Slider {
Item { Item {
id: indicatorBar id: indicatorBar
clip: true clip: true
visible: indicatorBarVisible
x: _root.zeroCentered ? zeroCenteredIndicatorStart : 0 x: _root.zeroCentered ? zeroCenteredIndicatorStart : 0
width: _root.zeroCentered ? centerIndicatorWidth : styleData.handlePosition width: _root.zeroCentered ? centerIndicatorWidth : styleData.handlePosition
height: parent.height height: parent.height

Loading…
Cancel
Save