Commit 3081cb60 authored by DonLakeFlyer's avatar DonLakeFlyer

parent c9d3aa72
...@@ -54,6 +54,7 @@ Item { ...@@ -54,6 +54,7 @@ Item {
property real _pipSize: mainWindow.width * 0.2 property real _pipSize: mainWindow.width * 0.2
property alias _guidedController: guidedActionsController property alias _guidedController: guidedActionsController
property alias _altitudeSlider: altitudeSlider property alias _altitudeSlider: altitudeSlider
property real _toolsMargin: ScreenTools.defaultFontPixelWidth * 0.75
readonly property var _dynamicCameras: activeVehicle ? activeVehicle.dynamicCameras : null readonly property var _dynamicCameras: activeVehicle ? activeVehicle.dynamicCameras : null
readonly property bool _isCamera: _dynamicCameras ? _dynamicCameras.cameras.count > 0 : false readonly property bool _isCamera: _dynamicCameras ? _dynamicCameras.cameras.count > 0 : false
...@@ -357,7 +358,7 @@ Item { ...@@ -357,7 +358,7 @@ Item {
// Do anchors again after popup // Do anchors again after popup
anchors.left = _mapAndVideo.left anchors.left = _mapAndVideo.left
anchors.bottom = _mapAndVideo.bottom anchors.bottom = _mapAndVideo.bottom
anchors.margins = ScreenTools.defaultFontPixelHeight anchors.margins = _toolsMargin
} }
} }
...@@ -365,8 +366,8 @@ Item { ...@@ -365,8 +366,8 @@ Item {
State { State {
name: "pipMode" name: "pipMode"
PropertyChanges { PropertyChanges {
target: _flightVideo target: _flightVideo
anchors.margins: ScreenTools.defaultFontPixelHeight anchors.margins: _toolsMargin
} }
PropertyChanges { PropertyChanges {
target: _flightVideoPipControl target: _flightVideoPipControl
...@@ -376,12 +377,12 @@ Item { ...@@ -376,12 +377,12 @@ Item {
State { State {
name: "fullMode" name: "fullMode"
PropertyChanges { PropertyChanges {
target: _flightVideo target: _flightVideo
anchors.margins: 0 anchors.margins: 0
} }
PropertyChanges { PropertyChanges {
target: _flightVideoPipControl target: _flightVideoPipControl
inPopup: false inPopup: false
} }
}, },
State { State {
...@@ -404,9 +405,9 @@ Item { ...@@ -404,9 +405,9 @@ Item {
ParentChange { ParentChange {
target: _flightVideo target: _flightVideo
parent: videoItem parent: videoItem
x: 0 x: 0
y: 0 y: 0
width: videoItem.width width: videoItem.width
height: videoItem.height height: videoItem.height
} }
}, },
...@@ -473,8 +474,8 @@ Item { ...@@ -473,8 +474,8 @@ Item {
Row { Row {
id: singleMultiSelector id: singleMultiSelector
anchors.topMargin: ScreenTools.toolbarHeight + _margins anchors.topMargin: ScreenTools.toolbarHeight + _toolsMargin
anchors.rightMargin: _margins anchors.rightMargin: _toolsMargin
anchors.right: parent.right anchors.right: parent.right
spacing: ScreenTools.defaultFontPixelWidth spacing: ScreenTools.defaultFontPixelWidth
z: _mapAndVideo.z + 4 z: _mapAndVideo.z + 4
...@@ -496,7 +497,7 @@ Item { ...@@ -496,7 +497,7 @@ Item {
FlightDisplayViewWidgets { FlightDisplayViewWidgets {
id: flightDisplayViewWidgets id: flightDisplayViewWidgets
z: _mapAndVideo.z + 4 z: _mapAndVideo.z + 4
height: availableHeight - (singleMultiSelector.visible ? singleMultiSelector.height + _margins : 0) - (ScreenTools.defaultFontPixelHeight * 0.5) height: availableHeight - (singleMultiSelector.visible ? singleMultiSelector.height + _toolsMargin : 0) - _toolsMargin
anchors.left: parent.left anchors.left: parent.left
anchors.right: altitudeSlider.visible ? altitudeSlider.left : parent.right anchors.right: altitudeSlider.visible ? altitudeSlider.left : parent.right
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
...@@ -519,7 +520,7 @@ Item { ...@@ -519,7 +520,7 @@ Item {
} }
MultiVehicleList { MultiVehicleList {
anchors.margins: _margins anchors.margins: _toolsMargin
anchors.top: singleMultiSelector.bottom anchors.top: singleMultiSelector.bottom
anchors.right: parent.right anchors.right: parent.right
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
...@@ -554,14 +555,14 @@ Item { ...@@ -554,14 +555,14 @@ Item {
visible: (activeVehicle ? activeVehicle.guidedModeSupported : true) && !QGroundControl.videoManager.fullScreen visible: (activeVehicle ? activeVehicle.guidedModeSupported : true) && !QGroundControl.videoManager.fullScreen
id: toolStrip id: toolStrip
anchors.leftMargin: isInstrumentRight() ? ScreenTools.defaultFontPixelWidth * 2 : undefined anchors.leftMargin: isInstrumentRight() ? _toolsMargin : undefined
anchors.left: isInstrumentRight() ? _mapAndVideo.left : undefined anchors.left: isInstrumentRight() ? _mapAndVideo.left : undefined
anchors.rightMargin:isInstrumentRight() ? undefined : ScreenTools.defaultFontPixelWidth anchors.rightMargin:isInstrumentRight() ? undefined : ScreenTools.defaultFontPixelWidth
anchors.right: isInstrumentRight() ? undefined : _mapAndVideo.right anchors.right: isInstrumentRight() ? undefined : _mapAndVideo.right
anchors.topMargin: ScreenTools.defaultFontPixelHeight * 0.5 anchors.topMargin: _toolsMargin
anchors.top: parent.top anchors.top: parent.top
z: _mapAndVideo.z + 4 z: _mapAndVideo.z + 4
maxHeight: (_flightVideo.visible ? _flightVideo.y : parent.height) - toolStrip.y maxHeight: parent.height - toolStrip.y + (_flightVideo.visible ? (_flightVideo.y - parent.height) : 0)
property bool _anyActionAvailable: _guidedController.showStartMission || _guidedController.showResumeMission || _guidedController.showChangeAlt || _guidedController.showLandAbort property bool _anyActionAvailable: _guidedController.showStartMission || _guidedController.showResumeMission || _guidedController.showChangeAlt || _guidedController.showLandAbort
property var _actionModel: [ property var _actionModel: [
......
...@@ -478,12 +478,11 @@ FlightMap { ...@@ -478,12 +478,11 @@ FlightMap {
MapScale { MapScale {
id: mapScale id: mapScale
anchors.right: parent.right anchors.right: parent.right
anchors.margins: ScreenTools.defaultFontPixelHeight * (0.33) anchors.margins: _toolsMargin
anchors.topMargin: ScreenTools.defaultFontPixelHeight * (0.33) + state === "bottomMode" ? 0 : ScreenTools.toolbarHeight anchors.topMargin: _toolsMargin + state === "bottomMode" ? 0 : ScreenTools.toolbarHeight
anchors.bottomMargin: ScreenTools.defaultFontPixelHeight * (0.33)
mapControl: flightMap mapControl: flightMap
buttonsOnLeft: false buttonsOnLeft: false
visible: !ScreenTools.isTinyScreen && QGroundControl.corePlugin.options.enableMapScale visible: !ScreenTools.isTinyScreen && QGroundControl.corePlugin.options.enableMapScale && mainIsMap
state: "bottomMode" state: "bottomMode"
states: [ states: [
State { State {
......
...@@ -170,8 +170,8 @@ Item { ...@@ -170,8 +170,8 @@ Item {
id: instrumentsColumn id: instrumentsColumn
spacing: ScreenTools.defaultFontPixelHeight * 0.25 spacing: ScreenTools.defaultFontPixelHeight * 0.25
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: QGroundControl.corePlugin.options.instrumentWidget ? (QGroundControl.corePlugin.options.instrumentWidget.widgetTopMargin + (ScreenTools.defaultFontPixelHeight * 0.5)) : 0 anchors.topMargin: QGroundControl.corePlugin.options.instrumentWidget ? (QGroundControl.corePlugin.options.instrumentWidget.widgetTopMargin + _toolsMargin) : 0
anchors.margins: ScreenTools.defaultFontPixelHeight * 0.5 anchors.margins: _toolsMargin
anchors.right: parent.right anchors.right: parent.right
//------------------------------------------------------- //-------------------------------------------------------
// Airmap Airspace Control // Airmap Airspace Control
...@@ -185,7 +185,7 @@ Item { ...@@ -185,7 +185,7 @@ Item {
//-- Instrument Panel //-- Instrument Panel
Loader { Loader {
id: instrumentsLoader id: instrumentsLoader
anchors.margins: ScreenTools.defaultFontPixelHeight * 0.5 anchors.margins: _toolsMargin
property real maxHeight: widgetRoot ? widgetRoot.height - instrumentsColumn.y - airspaceControl.height - (ScreenTools.defaultFontPixelHeight * 4) : 0 property real maxHeight: widgetRoot ? widgetRoot.height - instrumentsColumn.y - airspaceControl.height - (ScreenTools.defaultFontPixelHeight * 4) : 0
states: [ states: [
State { State {
......
...@@ -34,7 +34,7 @@ Item { ...@@ -34,7 +34,7 @@ Item {
readonly property int _decimalPlaces: 8 readonly property int _decimalPlaces: 8
readonly property real _margin: ScreenTools.defaultFontPixelHeight * 0.5 readonly property real _margin: ScreenTools.defaultFontPixelHeight * 0.5
readonly property real _toolsTopMargin: ScreenTools.defaultFontPixelHeight * 0.5 readonly property real _toolsMargin: ScreenTools.defaultFontPixelWidth * 0.75
readonly property real _radius: ScreenTools.defaultFontPixelWidth * 0.5 readonly property real _radius: ScreenTools.defaultFontPixelWidth * 0.5
readonly property real _rightPanelWidth: Math.min(parent.width / 3, ScreenTools.defaultFontPixelWidth * 30) readonly property real _rightPanelWidth: Math.min(parent.width / 3, ScreenTools.defaultFontPixelWidth * 30)
readonly property var _defaultVehicleCoordinate: QtPositioning.coordinate(37.803784, -122.462276) readonly property var _defaultVehicleCoordinate: QtPositioning.coordinate(37.803784, -122.462276)
...@@ -367,7 +367,7 @@ Item { ...@@ -367,7 +367,7 @@ Item {
planView: true planView: true
// This is the center rectangle of the map which is not obscured by tools // This is the center rectangle of the map which is not obscured by tools
property rect centerViewport: Qt.rect(_leftToolWidth + _margin, _toolsTopMargin, editorMap.width - _leftToolWidth - _rightToolWidth - (_margin * 2), mapScale.y - _margin - _toolsTopMargin) property rect centerViewport: Qt.rect(_leftToolWidth + _margin, _toolsMargin, editorMap.width - _leftToolWidth - _rightToolWidth - (_margin * 2), mapScale.y - _margin - _toolsMargin)
property real _leftToolWidth: toolStrip.x + toolStrip.width property real _leftToolWidth: toolStrip.x + toolStrip.width
property real _rightToolWidth: rightPanel.width + rightPanel.anchors.rightMargin property real _rightToolWidth: rightPanel.width + rightPanel.anchors.rightMargin
...@@ -536,12 +536,11 @@ Item { ...@@ -536,12 +536,11 @@ Item {
// Left tool strip // Left tool strip
ToolStrip { ToolStrip {
id: toolStrip id: toolStrip
anchors.leftMargin: ScreenTools.defaultFontPixelWidth * 2 anchors.margins: _toolsMargin
anchors.left: parent.left anchors.left: parent.left
anchors.topMargin: _toolsTopMargin
anchors.top: parent.top anchors.top: parent.top
z: QGroundControl.zOrderWidgets z: QGroundControl.zOrderWidgets
maxHeight: mapScale.y - toolStrip.y maxHeight: parent.height - toolStrip.y
readonly property int flyButtonIndex: 0 readonly property int flyButtonIndex: 0
readonly property int fileButtonIndex: 1 readonly property int fileButtonIndex: 1
...@@ -638,11 +637,16 @@ Item { ...@@ -638,11 +637,16 @@ Item {
} }
break break
case roiButtonIndex: case roiButtonIndex:
allAddClickBoolsOff() if (_addROIOnClick) {
if (_missionController.isROIActive) { allAddClickBoolsOff()
insertCancelROIAfterCurrent() setChecked(index, false)
} else { } else {
_addROIOnClick = checked allAddClickBoolsOff()
if (_missionController.isROIActive) {
insertCancelROIAfterCurrent()
} else {
_addROIOnClick = checked
}
} }
break break
case patternButtonIndex: case patternButtonIndex:
...@@ -673,13 +677,13 @@ Item { ...@@ -673,13 +677,13 @@ Item {
opacity: planExpanded.visible ? 0.2 : 0 opacity: planExpanded.visible ? 0.2 : 0
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: ScreenTools.defaultFontPixelWidth anchors.rightMargin: _toolsMargin
} }
//------------------------------------------------------- //-------------------------------------------------------
// Right Panel Controls // Right Panel Controls
Item { Item {
anchors.fill: rightPanel anchors.fill: rightPanel
anchors.topMargin: _toolsTopMargin anchors.topMargin: _toolsMargin
DeadMouseArea { DeadMouseArea {
anchors.fill: parent anchors.fill: parent
} }
...@@ -857,28 +861,15 @@ Item { ...@@ -857,28 +861,15 @@ Item {
} }
} }
MapScale {
id: mapScale
anchors.margins: ScreenTools.defaultFontPixelHeight * (0.66)
anchors.bottom: waypointValuesDisplay.visible ? waypointValuesDisplay.top : parent.bottom
anchors.left: parent.left
mapControl: editorMap
buttonsOnLeft: true
terrainButtonVisible: _editingLayer === _layerMission
visible: _toolStripBottom < y
terrainButtonChecked: waypointValuesDisplay.visible
onTerrainButtonClicked: waypointValuesDisplay.toggleVisible()
}
MissionItemStatus { MissionItemStatus {
id: waypointValuesDisplay id: waypointValuesDisplay
anchors.margins: ScreenTools.defaultFontPixelWidth anchors.margins: _toolsMargin
anchors.left: parent.left anchors.left: toolStrip.right
anchors.bottom: mapScale.top
height: ScreenTools.defaultFontPixelHeight * 7 height: ScreenTools.defaultFontPixelHeight * 7
maxWidth: parent.width - rightPanel.width - x maxWidth: rightPanel.x - x - anchors.margins
anchors.bottom: parent.bottom
missionItems: _missionController.visualItems missionItems: _missionController.visualItems
visible: _internalVisible && _editingLayer === _layerMission && (_toolStripBottom + mapScale.height) < y && QGroundControl.corePlugin.options.showMissionStatus visible: _internalVisible && _editingLayer === _layerMission && QGroundControl.corePlugin.options.showMissionStatus
property bool _internalVisible: false property bool _internalVisible: false
...@@ -886,6 +877,19 @@ Item { ...@@ -886,6 +877,19 @@ Item {
_internalVisible = !_internalVisible _internalVisible = !_internalVisible
} }
} }
MapScale {
id: mapScale
anchors.margins: _toolsMargin
anchors.bottom: parent.bottom
anchors.left: toolStrip.right
mapControl: editorMap
buttonsOnLeft: true
terrainButtonVisible: _editingLayer === _layerMission
terrainButtonChecked: waypointValuesDisplay.visible
onTerrainButtonClicked: waypointValuesDisplay.toggleVisible()
}
} }
Component { Component {
......
...@@ -19,7 +19,7 @@ Rectangle { ...@@ -19,7 +19,7 @@ Rectangle {
id: _root id: _root
color: qgcPal.globalTheme === QGCPalette.Light ? QGroundControl.corePlugin.options.toolbarBackgroundLight : QGroundControl.corePlugin.options.toolbarBackgroundDark color: qgcPal.globalTheme === QGCPalette.Light ? QGroundControl.corePlugin.options.toolbarBackgroundLight : QGroundControl.corePlugin.options.toolbarBackgroundDark
width: _idealWidth < repeater.contentWidth ? repeater.contentWidth : _idealWidth width: _idealWidth < repeater.contentWidth ? repeater.contentWidth : _idealWidth
height: toolStripColumn.height + (toolStripColumn.anchors.margins * 2) height: Math.min(maxHeight, toolStripColumn.height + (toolStripColumn.anchors.margins * 2))
radius: ScreenTools.defaultFontPixelWidth / 2 radius: ScreenTools.defaultFontPixelWidth / 2
property alias model: repeater.model property alias model: repeater.model
...@@ -51,48 +51,60 @@ Rectangle { ...@@ -51,48 +51,60 @@ Rectangle {
buttons: toolStripColumn.children buttons: toolStripColumn.children
} }
Column { DeadMouseArea {
id: toolStripColumn anchors.fill: parent
}
QGCFlickable {
anchors.margins: ScreenTools.defaultFontPixelWidth * 0.4 anchors.margins: ScreenTools.defaultFontPixelWidth * 0.4
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
spacing: ScreenTools.defaultFontPixelWidth * 0.25 height: parent.height
contentHeight: toolStripColumn.height
Repeater { flickableDirection: Flickable.VerticalFlick
id: repeater
Column {
QGCHoverButton { id: toolStripColumn
id: buttonTemplate anchors.left: parent.left
anchors.right: parent.right
anchors.left: toolStripColumn.left spacing: ScreenTools.defaultFontPixelWidth * 0.25
anchors.right: toolStripColumn.right
height: width Repeater {
radius: ScreenTools.defaultFontPixelWidth / 2 id: repeater
fontPointSize: ScreenTools.smallFontPointSize
autoExclusive: true QGCHoverButton {
id: buttonTemplate
enabled: modelData.buttonEnabled
visible: modelData.buttonVisible anchors.left: toolStripColumn.left
imageSource: modelData.showAlternateIcon ? modelData.alternateIconSource : modelData.iconSource anchors.right: toolStripColumn.right
text: modelData.name height: width
checked: modelData.checked !== undefined ? modelData.checked : checked radius: ScreenTools.defaultFontPixelWidth / 2
fontPointSize: ScreenTools.smallFontPointSize
ButtonGroup.group: buttonGroup autoExclusive: true
// Only drop panel and toggleable are checkable
checkable: modelData.dropPanelComponent !== undefined || (modelData.toggle !== undefined && modelData.toggle) enabled: modelData.buttonEnabled
visible: modelData.buttonVisible
onClicked: { imageSource: modelData.showAlternateIcon ? modelData.alternateIconSource : modelData.iconSource
dropPanel.hide() // DropPanel will call hide on "lastClickedButton" text: modelData.name
if (modelData.dropPanelComponent === undefined) { checked: modelData.checked !== undefined ? modelData.checked : checked
_root.clicked(index, checked)
} else if (checked) { ButtonGroup.group: buttonGroup
var panelEdgeTopPoint = mapToItem(_root, width, 0) // Only drop panel and toggleable are checkable
dropPanel.show(panelEdgeTopPoint, height, modelData.dropPanelComponent) checkable: modelData.dropPanelComponent !== undefined || (modelData.toggle !== undefined && modelData.toggle)
_root.dropped(index)
onClicked: {
dropPanel.hide() // DropPanel will call hide on "lastClickedButton"
if (modelData.dropPanelComponent === undefined) {
_root.clicked(index, checked)
} else if (checked) {
var panelEdgeTopPoint = mapToItem(_root, width, 0)
dropPanel.show(panelEdgeTopPoint, height, modelData.dropPanelComponent)
_root.dropped(index)
}
if(_root && buttonTemplate)
_root.lastClickedButton = buttonTemplate
} }
if(_root && buttonTemplate)
_root.lastClickedButton = buttonTemplate
} }
} }
} }
......
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