From 73cb69ebb6e8fdb3c92f115eadef4b107835006f Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Wed, 17 Feb 2021 15:11:03 -0800 Subject: [PATCH] Revert "TelemetryValuesBar: custom transparency by settings" This reverts commit 671943640d4239e3337a6be80608e1076c8657eb. --- src/FlightDisplay/TelemetryValuesBar.qml | 17 ++++++----- src/Settings/App.SettingsGroup.json | 9 ------ src/Settings/AppSettings.cc | 1 - src/Settings/AppSettings.h | 1 - src/ui/preferences/GeneralSettings.qml | 49 -------------------------------- 5 files changed, 8 insertions(+), 69 deletions(-) diff --git a/src/FlightDisplay/TelemetryValuesBar.qml b/src/FlightDisplay/TelemetryValuesBar.qml index 8e0be35..1f4b1e1 100644 --- a/src/FlightDisplay/TelemetryValuesBar.qml +++ b/src/FlightDisplay/TelemetryValuesBar.qml @@ -7,23 +7,22 @@ * ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Layouts 1.12 +import QtQuick 2.12 +import QtQuick.Layouts 1.12 -import QGroundControl 1.0 -import QGroundControl.ScreenTools 1.0 -import QGroundControl.Vehicle 1.0 -import QGroundControl.Controls 1.0 -import QGroundControl.Palette 1.0 +import QGroundControl 1.0 +import QGroundControl.ScreenTools 1.0 +import QGroundControl.Vehicle 1.0 +import QGroundControl.Controls 1.0 +import QGroundControl.Palette 1.0 Rectangle { id: telemetryPanel height: telemetryLayout.height + (_toolsMargin * 2) width: telemetryLayout.width + (_toolsMargin * 2) - color: Qt.hsla(_baseBGColor.hslHue, _baseBGColor.hslSaturation, _baseBGColor.hslLightness, _telemetryPanelAlpha) + color: Qt.hsla(_baseBGColor.hslHue, _baseBGColor.hslSaturation, _baseBGColor.hslLightness, 0.5) radius: ScreenTools.defaultFontPixelWidth / 2 - property real _telemetryPanelAlpha: QGroundControl.settingsManager.appSettings.instrumentWidgetAlpha.value property color _baseBGColor: qgcPal.window DeadMouseArea { anchors.fill: parent } diff --git a/src/Settings/App.SettingsGroup.json b/src/Settings/App.SettingsGroup.json index 51e7596..dfc22cb 100644 --- a/src/Settings/App.SettingsGroup.json +++ b/src/Settings/App.SettingsGroup.json @@ -316,15 +316,6 @@ "shortDesc": "Use COMPONENT_INFORMATION query (beta)", "type": "bool", "default": false -}, -{ - "name": "instrumentWidgetAlpha", - "shortDesc": "Intrument widget opacity", - "type": "float", - "units": "pt", - "min": 0, - "max": 1, - "default": 0.5 } ] } diff --git a/src/Settings/AppSettings.cc b/src/Settings/AppSettings.cc index 78fb797..18eab3d 100644 --- a/src/Settings/AppSettings.cc +++ b/src/Settings/AppSettings.cc @@ -137,7 +137,6 @@ DECLARE_SETTINGSFACT(AppSettings, firstRunPromptIdsShown) DECLARE_SETTINGSFACT(AppSettings, forwardMavlink) DECLARE_SETTINGSFACT(AppSettings, forwardMavlinkHostName) DECLARE_SETTINGSFACT(AppSettings, useComponentInformationQuery) -DECLARE_SETTINGSFACT(AppSettings, instrumentWidgetAlpha) DECLARE_SETTINGSFACT_NO_FUNC(AppSettings, indoorPalette) { diff --git a/src/Settings/AppSettings.h b/src/Settings/AppSettings.h index 80c5e08..9236fb4 100644 --- a/src/Settings/AppSettings.h +++ b/src/Settings/AppSettings.h @@ -64,7 +64,6 @@ public: DEFINE_SETTINGFACT(forwardMavlink) DEFINE_SETTINGFACT(forwardMavlinkHostName) DEFINE_SETTINGFACT(useComponentInformationQuery) - DEFINE_SETTINGFACT(instrumentWidgetAlpha) // Although this is a global setting it only affects ArduPilot vehicle since PX4 automatically starts the stream from the vehicle side DEFINE_SETTINGFACT(apmStartMavlinkStreams) diff --git a/src/ui/preferences/GeneralSettings.qml b/src/ui/preferences/GeneralSettings.qml index c8b9aa7..df660a9 100644 --- a/src/ui/preferences/GeneralSettings.qml +++ b/src/ui/preferences/GeneralSettings.qml @@ -32,7 +32,6 @@ Rectangle { property Fact _savePath: QGroundControl.settingsManager.appSettings.savePath property Fact _appFontPointSize: QGroundControl.settingsManager.appSettings.appFontPointSize - property Fact _instrumentWidetAlpha: QGroundControl.settingsManager.appSettings.instrumentWidgetAlpha property Fact _userBrandImageIndoor: QGroundControl.settingsManager.brandImageSettings.userBrandImageIndoor property Fact _userBrandImageOutdoor: QGroundControl.settingsManager.brandImageSettings.userBrandImageOutdoor property Fact _virtualJoystick: QGroundControl.settingsManager.appSettings.virtualJoystick @@ -584,54 +583,6 @@ Rectangle { } } } - QGCLabel { - text: qsTr("Telemetry widget opacity") - visible: _instrumentWidetAlpha.visible - Layout.alignment: Qt.AlignVCenter - } - Item { - width: _comboFieldWidth - height: instrumentWidgetEdit.height * 1.5 - visible: _instrumentWidetAlpha.visible - Layout.alignment: Qt.AlignVCenter - Row { - spacing: ScreenTools.defaultFontPixelWidth - anchors.verticalCenter: parent.verticalCenter - QGCButton { - width: height - height: instrumentWidgetEdit.height * 1.5 - text: "-" - anchors.verticalCenter: parent.verticalCenter - onClicked: { - if (_instrumentWidetAlpha.value > _instrumentWidetAlpha.min) { - _instrumentWidetAlpha.value = _instrumentWidetAlpha.value - 0.05 - } - } - } - QGCLabel { - id: instrumentWidgetEdit - width: ScreenTools.defaultFontPixelWidth * 6 - text: (QGroundControl.settingsManager.appSettings.instrumentWidgetAlpha.value * 100).toFixed(0) + "%" - horizontalAlignment: Text.AlignHCenter - anchors.verticalCenter: parent.verticalCenter - } - Text { - - } - - QGCButton { - width: height - height: instrumentWidgetEdit.height * 1.5 - text: "+" - anchors.verticalCenter: parent.verticalCenter - onClicked: { - if (_instrumentWidetAlpha.value < _instrumentWidetAlpha.max) { - _instrumentWidetAlpha.value = _instrumentWidetAlpha.value + 0.05 - } - } - } - } - } } }