Browse Source

Merge pull request #9015 from DonLakeFlyer/InstrumenPosition

Fix instrument panel positioning at high scaling
QGC4.4
Don Gagne 5 years ago committed by GitHub
parent
commit
eb07fbba8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      qgroundcontrol.qrc
  2. 13
      src/FlightDisplay/FlightDisplayViewWidgets.qml
  3. 101
      src/FlightMap/Widgets/InstrumentSwipeView.qml
  4. 1
      src/QmlControls/QGroundControl/FlightMap/qmldir

1
qgroundcontrol.qrc

@ -235,7 +235,6 @@
<file alias="QGroundControl/FlightMap/CompassRing.qml">src/FlightMap/Widgets/CompassRing.qml</file> <file alias="QGroundControl/FlightMap/CompassRing.qml">src/FlightMap/Widgets/CompassRing.qml</file>
<file alias="QGroundControl/FlightMap/CustomMapItems.qml">src/FlightMap/MapItems/CustomMapItems.qml</file> <file alias="QGroundControl/FlightMap/CustomMapItems.qml">src/FlightMap/MapItems/CustomMapItems.qml</file>
<file alias="QGroundControl/FlightMap/FlightMap.qml">src/FlightMap/FlightMap.qml</file> <file alias="QGroundControl/FlightMap/FlightMap.qml">src/FlightMap/FlightMap.qml</file>
<file alias="QGroundControl/FlightMap/InstrumentSwipeView.qml">src/FlightMap/Widgets/InstrumentSwipeView.qml</file>
<file alias="QGroundControl/FlightMap/MapFitFunctions.qml">src/FlightMap/Widgets/MapFitFunctions.qml</file> <file alias="QGroundControl/FlightMap/MapFitFunctions.qml">src/FlightMap/Widgets/MapFitFunctions.qml</file>
<file alias="QGroundControl/FlightMap/MapScale.qml">src/FlightMap/MapScale.qml</file> <file alias="QGroundControl/FlightMap/MapScale.qml">src/FlightMap/MapScale.qml</file>
<file alias="QGroundControl/FlightMap/MissionItemIndicator.qml">src/FlightMap/MapItems/MissionItemIndicator.qml</file> <file alias="QGroundControl/FlightMap/MissionItemIndicator.qml">src/FlightMap/MapItems/MissionItemIndicator.qml</file>

13
src/FlightDisplay/FlightDisplayViewWidgets.qml

@ -22,15 +22,10 @@ import QGroundControl.Palette 1.0
import QGroundControl.Vehicle 1.0 import QGroundControl.Vehicle 1.0
import QGroundControl.FlightMap 1.0 import QGroundControl.FlightMap 1.0
Column { Loader {
id: _root width: parent.width
spacing: ScreenTools.defaultFontPixelHeight * 0.25 source: QGroundControl.settingsManager.flyViewSettings.alternateInstrumentPanel.rawValue ?
"qrc:/qml/QGCInstrumentWidgetAlternate.qml" : "qrc:/qml/QGCInstrumentWidget.qml"
property var missionController property var missionController
Loader {
width: parent.width
source: QGroundControl.settingsManager.flyViewSettings.alternateInstrumentPanel.rawValue ?
"qrc:/qml/QGCInstrumentWidgetAlternate.qml" : "qrc:/qml/QGCInstrumentWidget.qml"
}
} }

101
src/FlightMap/Widgets/InstrumentSwipeView.qml

@ -1,101 +0,0 @@
import QtQuick 2.3
import QtQuick.Controls 1.2
import QtQuick.Layouts 1.2
import QGroundControl.Palette 1.0
import QGroundControl.ScreenTools 1.0
import QGroundControl.FlightMap 1.0
Item {
id: _root
clip: true
height: column.height
property color textColor
property color backgroundColor
property var maxHeight ///< Maximum height that should be taken, smaller than this is ok
property real _margins: ScreenTools.defaultFontPixelWidth / 2
property real _pageWidth: _root.width
property int _currentPage: 0
property int _maxPage: 3
onWidthChanged: showPage(_currentPage)
function showPicker() {
valuesPage.showPicker()
}
function showPage(pageIndex) {
pageRow.x = -(pageIndex * _pageWidth)
_currentPage = pageIndex
}
function showNextPage() {
if (_currentPage == _maxPage) {
_currentPage = 0
} else {
_currentPage++
}
showPage(_currentPage)
}
function currentPage() {
return _currentPage
}
MouseArea {
anchors.fill: parent
onClicked: showNextPage()
}
Column {
id: column
anchors.left: parent.left
anchors.right: parent.right
Row {
id: pageRow
ValuesWidget {
id: valuesPage
width: _pageWidth
textColor: _root.textColor
maxHeight: _root.maxHeight
}
CameraWidget {
width: _pageWidth
textColor: _root.textColor
maxHeight: _root.maxHeight
}
VehicleHealthWidget {
width: _pageWidth
textColor: _root.textColor
maxHeight: _root.maxHeight
}
VibrationWidget {
width: _pageWidth
textColor: _root.textColor
backgroundColor: _root.backgroundColor
maxHeight: _root.maxHeight
}
}
Row {
anchors.horizontalCenter: parent.horizontalCenter
spacing: _margins
Repeater {
model: _maxPage + 1
Rectangle {
height: radius * 2
width: radius * 2
radius: ScreenTools.defaultFontPixelWidth / 3
border.color: textColor
border.width: 1
color: _currentPage == index ? textColor : "transparent"
}
}
}
}
}

1
src/QmlControls/QGroundControl/FlightMap/qmldir

@ -8,7 +8,6 @@ QGCVideoBackground 1.0 QGCVideoBackground.qml
CenterMapDropButton 1.0 CenterMapDropButton.qml CenterMapDropButton 1.0 CenterMapDropButton.qml
CenterMapDropPanel 1.0 CenterMapDropPanel.qml CenterMapDropPanel 1.0 CenterMapDropPanel.qml
CompassRing 1.0 CompassRing.qml CompassRing 1.0 CompassRing.qml
InstrumentSwipeView 1.0 InstrumentSwipeView.qml
MapFitFunctions 1.0 MapFitFunctions.qml MapFitFunctions 1.0 MapFitFunctions.qml
MapLineArrow 1.0 MapLineArrow.qml MapLineArrow 1.0 MapLineArrow.qml
MapScale 1.0 MapScale.qml MapScale 1.0 MapScale.qml

Loading…
Cancel
Save