Commit fa793fe4 authored by Stefan Dunca's avatar Stefan Dunca Committed by Gus Grubba

New toolstrip based on QGCHoverButton

parent a08427a3
...@@ -561,16 +561,16 @@ Item { ...@@ -561,16 +561,16 @@ Item {
ToolStrip { ToolStrip {
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 : undefined
anchors.leftMargin: isInstrumentRight() ? ScreenTools.defaultFontPixelWidth * 2 : 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.toolbarHeight + (_margins * 2) anchors.topMargin: ScreenTools.toolbarHeight + anchors.leftMargin
anchors.top: _mapAndVideo.top anchors.top: _mapAndVideo.top
z: _mapAndVideo.z + 4 z: _mapAndVideo.z + 4
title: qsTr("Fly")
maxHeight: (_flightVideo.visible ? _flightVideo.y : parent.height) - toolStrip.y maxHeight: (_flightVideo.visible ? _flightVideo.y : parent.height) - toolStrip.y
buttonVisible: [_useChecklist, _guidedController.showTakeoff || !_guidedController.showLand, _guidedController.showLand && !_guidedController.showTakeoff, true, true, true ] buttonVisible: [_useChecklist, _guidedController.showTakeoff || !_guidedController.showLand, _guidedController.showLand && !_guidedController.showTakeoff, true, _guidedController.showPause, !_guidedController.showPause ]
buttonEnabled: [_useChecklist && activeVehicle, _guidedController.showTakeoff, _guidedController.showLand, _guidedController.showRTL, _guidedController.showPause, _anyActionAvailable ] buttonEnabled: [_useChecklist && activeVehicle, _guidedController.showTakeoff, _guidedController.showLand, _guidedController.showRTL, _guidedController.showPause, _anyActionAvailable ]
property bool _anyActionAvailable: _guidedController.showStartMission || _guidedController.showResumeMission || _guidedController.showChangeAlt || _guidedController.showLandAbort property bool _anyActionAvailable: _guidedController.showStartMission || _guidedController.showResumeMission || _guidedController.showChangeAlt || _guidedController.showLandAbort
......
...@@ -286,7 +286,7 @@ Item { ...@@ -286,7 +286,7 @@ Item {
var sequenceNumber = _missionController.insertROIMissionItem(coordinate, index) var sequenceNumber = _missionController.insertROIMissionItem(coordinate, index)
_missionController.setCurrentPlanViewIndex(sequenceNumber, true) _missionController.setCurrentPlanViewIndex(sequenceNumber, true)
_addROIOnClick = false _addROIOnClick = false
toolStrip.uncheckAll() toolStrip.lastClickedButton.checked = false
} }
property int _moveDialogMissionItemIndex property int _moveDialogMissionItemIndex
...@@ -533,64 +533,64 @@ Item { ...@@ -533,64 +533,64 @@ Item {
border.width: object.lineWidth border.width: object.lineWidth
} }
} }
}
ToolStrip { //-----------------------------------------------------------
id: toolStrip // Left tool strip
anchors.leftMargin: ScreenTools.defaultFontPixelWidth ToolStrip {
anchors.left: parent.left id: toolStrip
anchors.topMargin: _toolButtonTopMargin anchors.leftMargin: ScreenTools.defaultFontPixelWidth * 2
anchors.top: parent.top anchors.left: parent.left
color: qgcPal.window anchors.topMargin: _toolButtonTopMargin + anchors.leftMargin
title: qsTr("Plan") anchors.top: parent.top
z: QGroundControl.zOrderWidgets z: QGroundControl.zOrderWidgets
showAlternateIcon: [ _planMasterController.dirty, false, false, false, false, false, false ] showAlternateIcon: [ _planMasterController.dirty, false, false, false, false, false, false ]
rotateImage: [ _planMasterController.syncInProgress, false, false, false, false, false, false ] rotateImage: [ _planMasterController.syncInProgress, false, false, false, false, false, false ]
animateImage: [ _planMasterController.dirty, false, false, false, false, false, false ] animateImage: [ _planMasterController.dirty, false, false, false, false, false, false ]
buttonEnabled: [ !_planMasterController.syncInProgress, true, true, true, true, true, true ] buttonEnabled: [ !_planMasterController.syncInProgress, true, true, true, true, true, true ]
buttonVisible: [ true, true, _waypointsOnlyMode, true, true, _showZoom, _showZoom ] buttonVisible: [ true, true, _waypointsOnlyMode, true, true, _showZoom, _showZoom ]
maxHeight: mapScale.y - toolStrip.y maxHeight: mapScale.y - toolStrip.y
property bool _showZoom: !ScreenTools.isMobile
property bool _showZoom: !ScreenTools.isMobile
model: [
model: [ {
{ name: qsTr("File"),
name: qsTr("File"), iconSource: "/qmlimages/MapSync.svg",
iconSource: "/qmlimages/MapSync.svg", alternateIconSource: "/qmlimages/MapSyncChanged.svg",
alternateIconSource: "/qmlimages/MapSyncChanged.svg", dropPanelComponent: syncDropPanel
dropPanelComponent: syncDropPanel },
}, {
{ name: qsTr("Waypoint"),
name: qsTr("Waypoint"), iconSource: "/qmlimages/MapAddMission.svg",
iconSource: "/qmlimages/MapAddMission.svg", toggle: true
toggle: true },
}, {
{ name: qsTr("ROI"),
name: qsTr("ROI"), iconSource: "/qmlimages/MapAddMission.svg",
iconSource: "/qmlimages/MapAddMission.svg", toggle: true
toggle: true },
}, {
{ name: _singleComplexItem ? _missionController.complexMissionItemNames[0] : qsTr("Pattern"),
name: _singleComplexItem ? _missionController.complexMissionItemNames[0] : qsTr("Pattern"), iconSource: "/qmlimages/MapDrawShape.svg",
iconSource: "/qmlimages/MapDrawShape.svg", dropPanelComponent: _singleComplexItem ? undefined : patternDropPanel
dropPanelComponent: _singleComplexItem ? undefined : patternDropPanel },
}, {
{ name: qsTr("Center"),
name: qsTr("Center"), iconSource: "/qmlimages/MapCenter.svg",
iconSource: "/qmlimages/MapCenter.svg", dropPanelComponent: centerMapDropPanel
dropPanelComponent: centerMapDropPanel },
}, {
{ name: qsTr("In"),
name: qsTr("In"), iconSource: "/qmlimages/ZoomPlus.svg"
iconSource: "/qmlimages/ZoomPlus.svg" },
}, {
{ name: qsTr("Out"),
name: qsTr("Out"), iconSource: "/qmlimages/ZoomMinus.svg"
iconSource: "/qmlimages/ZoomMinus.svg" }
} ]
]
onClicked: { onClicked: {
switch (index) { switch (index) {
case 1: case 1:
_addWaypointOnClick = checked _addWaypointOnClick = checked
_addROIOnClick = false _addROIOnClick = false
...@@ -610,7 +610,6 @@ Item { ...@@ -610,7 +610,6 @@ Item {
case 6: case 6:
editorMap.zoomLevel -= 0.5 editorMap.zoomLevel -= 0.5
break break
}
} }
} }
} }
......
...@@ -63,7 +63,7 @@ Item { ...@@ -63,7 +63,7 @@ Item {
if (visible) { if (visible) {
visible = false visible = false
_dropDownComponent = undefined _dropDownComponent = undefined
toolStrip.uncheckAll() toolStrip.lastClickedButton.checked = false
} }
} }
......
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