From e56b1725f35afc0ffdf4bbef82833d307ee65f95 Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Fri, 4 Aug 2023 15:15:25 -0700 Subject: [PATCH] Increase size of click area for flight mode change --- src/ui/toolbar/FlightModeMenuIndicator.qml | 44 ++++++++++++++++++++---------- src/ui/toolbar/MainStatusIndicator.qml | 19 +------------ 2 files changed, 31 insertions(+), 32 deletions(-) diff --git a/src/ui/toolbar/FlightModeMenuIndicator.qml b/src/ui/toolbar/FlightModeMenuIndicator.qml index dbc1fc1..5ac65c8 100644 --- a/src/ui/toolbar/FlightModeMenuIndicator.qml +++ b/src/ui/toolbar/FlightModeMenuIndicator.qml @@ -16,9 +16,9 @@ import QGroundControl.MultiVehicleManager 1.0 import QGroundControl.ScreenTools 1.0 import QGroundControl.Palette 1.0 -RowLayout { - id: _root - spacing: 0 +Item { + id: _root + Layout.preferredWidth: rowLayout.width property real fontPointSize: ScreenTools.largeFontPointSize property var activeVehicle: QGroundControl.multiVehicleManager.activeVehicle @@ -68,19 +68,35 @@ RowLayout { } RowLayout { - Layout.fillWidth: true + id: rowLayout + spacing: 0 + height: parent.height + + QGCColoredImage { + id: flightModeIcon + width: ScreenTools.defaultFontPixelWidth * 2 + height: ScreenTools.defaultFontPixelHeight * 0.75 + fillMode: Image.PreserveAspectFit + mipmap: true + color: qgcPal.text + source: "/qmlimages/FlightModesComponentIcon.png" + Layout.alignment: Qt.AlignVCenter + } + + Item { + Layout.preferredWidth: ScreenTools.defaultFontPixelWidth / 2 + height: 1 + } QGCLabel { - text: activeVehicle ? activeVehicle.flightMode : qsTr("N/A", "No data to display") - font.pointSize: fontPointSize - Layout.alignment: Qt.AlignCenter - - MouseArea { - anchors.fill: parent - onClicked: { - mainWindow.showIndicatorPopup(_root, flightModeMenu) - } - } + text: activeVehicle ? activeVehicle.flightMode : qsTr("N/A", "No data to display") + font.pointSize: fontPointSize + Layout.alignment: Qt.AlignVCenter } } + + QGCMouseArea { + anchors.fill: parent + onClicked: mainWindow.showIndicatorPopup(_root, flightModeMenu) + } } diff --git a/src/ui/toolbar/MainStatusIndicator.qml b/src/ui/toolbar/MainStatusIndicator.qml index 8ff0fc9..1e2ff5f 100644 --- a/src/ui/toolbar/MainStatusIndicator.qml +++ b/src/ui/toolbar/MainStatusIndicator.qml @@ -107,7 +107,7 @@ RowLayout { } } - MouseArea { + QGCMouseArea { anchors.left: parent.left anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter @@ -122,23 +122,6 @@ RowLayout { height: 1 } - QGCColoredImage { - id: flightModeIcon - width: ScreenTools.defaultFontPixelWidth * 2 - height: ScreenTools.defaultFontPixelHeight * 0.75 - fillMode: Image.PreserveAspectFit - mipmap: true - color: qgcPal.text - source: "/qmlimages/FlightModesComponentIcon.png" - visible: flightModeMenu.visible - } - - Item { - Layout.preferredWidth: ScreenTools.defaultFontPixelWidth / 2 - height: 1 - visible: flightModeMenu.visible - } - FlightModeMenuIndicator { id: flightModeMenu Layout.preferredHeight: _root.height