Browse Source

Increase size of click area for flight mode change

QGC4.4
Don Gagne 2 years ago committed by Don Gagne
parent
commit
e56b1725f3
  1. 44
      src/ui/toolbar/FlightModeMenuIndicator.qml
  2. 19
      src/ui/toolbar/MainStatusIndicator.qml

44
src/ui/toolbar/FlightModeMenuIndicator.qml

@ -16,9 +16,9 @@ import QGroundControl.MultiVehicleManager 1.0 @@ -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 { @@ -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)
}
}

19
src/ui/toolbar/MainStatusIndicator.qml

@ -107,7 +107,7 @@ RowLayout { @@ -107,7 +107,7 @@ RowLayout {
}
}
MouseArea {
QGCMouseArea {
anchors.left: parent.left
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
@ -122,23 +122,6 @@ RowLayout { @@ -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

Loading…
Cancel
Save