Commit 9fc8a127 authored by Don Gagne's avatar Don Gagne

Remove global property usage

* Make MainToolbarIndicators reusable by other views
* Change to font based ratio sizing
parent 064be228
......@@ -17,6 +17,7 @@ import QGroundControl.ScreenTools 1.0
Item {
id: _root
width: height
state: "HelpShown"
clip: true
......
......@@ -29,11 +29,6 @@ Item {
QGCPalette { id: qgcPal; colorGroupEnabled: true }
property real tbHeight: ScreenTools.isMobile ? (ScreenTools.isTinyScreen ? (mainWindow.width * 0.0666) : (mainWindow.width * 0.05)) : ScreenTools.defaultFontPixelHeight * 3
property int tbCellHeight: tbHeight * 0.75
property real tbSpacing: ScreenTools.isMobile ? width * 0.00824 : 9.54
property real tbButtonWidth: tbCellHeight * 1.35
property real menuButtonWidth: (tbButtonWidth * 2) + (tbSpacing * 4) + 1
property var gcsPosition: QtPositioning.coordinate() // Starts as invalid coordinate
property var currentPopUp: null
property real currentCenterX: 0
......@@ -261,21 +256,19 @@ Item {
MainToolBar {
id: toolBar
height: tbHeight
height: ScreenTools.defaultFontPixelHeight * 3
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
mainWindow: mainWindow
isBackgroundDark: flightView.isBackgroundDark
z: QGroundControl.zOrderTopMost
onShowSettingsView: mainWindow.showSettingsView()
onShowSetupView: mainWindow.showSetupView()
onShowPlanView: mainWindow.showPlanView()
onShowFlyView: mainWindow.showFlyView()
onShowAnalyzeView: mainWindow.showAnalyzeView()
Component.onCompleted: {
ScreenTools.availableHeight = parent.height - toolBar.height
}
Component.onCompleted: ScreenTools.availableHeight = parent.height - toolBar.height
onShowSettingsView: mainWindow.showSettingsView()
onShowSetupView: mainWindow.showSetupView()
onShowPlanView: mainWindow.showPlanView()
onShowFlyView: mainWindow.showFlyView()
onShowAnalyzeView: mainWindow.showAnalyzeView()
}
Loader {
......@@ -365,7 +358,7 @@ Item {
border.width: 2
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
anchors.topMargin: tbHeight + ScreenTools.defaultFontPixelHeight
anchors.topMargin: toolBar.height + ScreenTools.defaultFontPixelHeight
MouseArea {
// This MouseArea prevents the Map below it from getting Mouse events. Without this
// things like mousewheel will scroll the Flickable and then scroll the map as well.
......@@ -443,7 +436,7 @@ Item {
radius: ScreenTools.defaultFontPixelHeight * 0.5
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
anchors.topMargin: tbHeight + ScreenTools.defaultFontPixelHeight / 2
anchors.topMargin: toolBar.height + ScreenTools.defaultFontPixelHeight / 2
border.color: "#808080"
border.width: 2
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment