From c05428b2735c2d48859224b9d6d205a9fc0d20e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Mon, 6 Dec 2021 07:51:40 +0100 Subject: [PATCH] ActuatorSlider: hide (blue) indicator bar while not active Particularly useful for servos, so it's clear which ones are controlled. --- src/AutoPilotPlugins/PX4/ActuatorSlider.qml | 3 ++- src/QmlControls/QGCSlider.qml | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/AutoPilotPlugins/PX4/ActuatorSlider.qml b/src/AutoPilotPlugins/PX4/ActuatorSlider.qml index e5deee9..ea60e04 100644 --- a/src/AutoPilotPlugins/PX4/ActuatorSlider.qml +++ b/src/AutoPilotPlugins/PX4/ActuatorSlider.qml @@ -43,7 +43,8 @@ Column { value: defaultVal updateValueWhileDragging: true anchors.horizontalCenter: parent.horizontalCenter - height: ScreenTools.defaultFontPixelHeight * _sliderHeight + height: ScreenTools.defaultFontPixelHeight * _sliderHeight + indicatorBarVisible: sendTimer.running onValueChanged: { if (blockUpdates) diff --git a/src/QmlControls/QGCSlider.qml b/src/QmlControls/QGCSlider.qml index 34f4fc8..7a41964 100644 --- a/src/QmlControls/QGCSlider.qml +++ b/src/QmlControls/QGCSlider.qml @@ -22,6 +22,7 @@ Slider { // Value indicator starts display from zero instead of min value property bool zeroCentered: false property bool displayValue: false + property bool indicatorBarVisible: true style: SliderStyle { groove: Item { @@ -40,6 +41,7 @@ Slider { Item { id: indicatorBar clip: true + visible: indicatorBarVisible x: _root.zeroCentered ? zeroCenteredIndicatorStart : 0 width: _root.zeroCentered ? centerIndicatorWidth : styleData.handlePosition height: parent.height