Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tool consistency ui tweaks #12356

Merged
merged 2 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions custom-example/src/FlyViewToolStripActionList.qml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,6 @@ ToolStripActionList {
signal displayPreFlightChecklist

model: [
ToolStripAction {
text: qsTr("Plan")
iconSource: "/qmlimages/Plan.svg"
onTriggered:{
mainWindow.showPlanView()
viewer3DWindow.close()
}
},
PreFlightCheckListShowAction { onTriggered: displayPreFlightChecklist() },
GuidedActionTakeoff { },
GuidedActionLand { },
Expand Down
3 changes: 1 addition & 2 deletions src/FlightDisplay/FlyViewToolStrip.qml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ import QGroundControl.Controls
import QGroundControl.FlightDisplay

ToolStrip {
id: _root
title: qsTr("Fly")
id: _root

signal displayPreFlightChecklist

Expand Down
8 changes: 0 additions & 8 deletions src/FlightDisplay/FlyViewToolStripActionList.qml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,6 @@ ToolStripActionList {
signal displayPreFlightChecklist

model: [
ToolStripAction {
text: qsTr("Plan")
iconSource: "/qmlimages/Plan.svg"
onTriggered:{
mainWindow.showPlanView()
viewer3DWindow.close()
}
},
ToolStripAction {
property bool _is3DViewOpen: viewer3DWindow.isOpen
property bool _viewer3DEnabled: QGroundControl.settingsManager.viewer3DSettings.enabled.rawValue
Expand Down
62 changes: 28 additions & 34 deletions src/PlanView/PlanToolBarIndicators.qml
Original file line number Diff line number Diff line change
Expand Up @@ -89,20 +89,44 @@ Item {
return complete
}

GridLayout {
RowLayout {
id: missionStats
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.leftMargin: _margins
anchors.left: parent.left
columnSpacing: 0
columns: 4
spacing: ScreenTools.defaultFontPixelWidth * 2

QGCButton {
id: uploadButton
text: _controllerDirty ? qsTr("Upload Required") : qsTr("Upload")
enabled: _utmspEnabled ? !_controllerSyncInProgress && UTMSPStateStorage.enableMissionUploadButton : !_controllerSyncInProgress
visible: !_controllerOffline && !_controllerSyncInProgress
primary: _controllerDirty
onClicked: {
if (_utmspEnabled) {
QGroundControl.utmspManager.utmspVehicle.triggerActivationStatusBar(true);
UTMSPStateStorage.removeFlightPlanState = true
UTMSPStateStorage.indicatorDisplayStatus = true
}
_planMasterController.upload();
}

PropertyAnimation on opacity {
easing.type: Easing.OutQuart
from: 0.5
to: 1
loops: Animation.Infinite
running: _controllerDirty && !_controllerSyncInProgress
alwaysRunToEnd: true
duration: 2000
}
}

GridLayout {
columns: 8
rowSpacing: _rowSpacing
columnSpacing: _labelToValueSpacing
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter

QGCLabel {
text: qsTr("Selected Waypoint")
Expand Down Expand Up @@ -156,7 +180,6 @@ Item {
columns: 5
rowSpacing: _rowSpacing
columnSpacing: _labelToValueSpacing
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter

QGCLabel {
text: qsTr("Total Mission")
Expand Down Expand Up @@ -192,7 +215,6 @@ Item {
columns: 3
rowSpacing: _rowSpacing
columnSpacing: _labelToValueSpacing
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
visible: _batteryInfoAvailable

QGCLabel {
Expand All @@ -207,34 +229,6 @@ Item {
font.pointSize: _dataFontSize
Layout.minimumWidth: _mediumValueWidth
}

Item { width: 1; height: 1 }
}

QGCButton {
id: uploadButton
text: _controllerDirty ? qsTr("Upload Required") : qsTr("Upload")
enabled: _utmspEnabled ? !_controllerSyncInProgress && UTMSPStateStorage.enableMissionUploadButton : !_controllerSyncInProgress
visible: !_controllerOffline && !_controllerSyncInProgress
primary: _controllerDirty
onClicked: {
if (_utmspEnabled) {
QGroundControl.utmspManager.utmspVehicle.triggerActivationStatusBar(true);
UTMSPStateStorage.removeFlightPlanState = true
UTMSPStateStorage.indicatorDisplayStatus = true
}
_planMasterController.upload();
}

PropertyAnimation on opacity {
easing.type: Easing.OutQuart
from: 0.5
to: 1
loops: Animation.Infinite
running: _controllerDirty && !_controllerSyncInProgress
alwaysRunToEnd: true
duration: 2000
}
}
}
}
Expand Down
6 changes: 0 additions & 6 deletions src/PlanView/PlanView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,6 @@ Item {
anchors.top: parent.top
z: QGroundControl.zOrderWidgets
maxHeight: parent.height - toolStrip.y
title: qsTr("Plan")

readonly property int flyButtonIndex: 0
readonly property int fileButtonIndex: 1
Expand All @@ -575,11 +574,6 @@ Item {
ToolStripActionList {
id: toolStripActionList
model: [
ToolStripAction {
text: qsTr("Fly")
iconSource: "/qmlimages/PaperPlane.svg"
onTriggered: mainWindow.showFlyView()
},
ToolStripAction {
text: qsTr("File")
enabled: !_planMasterController.syncInProgress
Expand Down
60 changes: 25 additions & 35 deletions src/UI/MainRootWindow.qml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ ApplicationWindow {
function showPlanView() {
flyView.visible = false
planView.visible = true
viewer3DWindow.close()
}

function showFlyView() {
Expand All @@ -143,7 +144,7 @@ ApplicationWindow {
}

function showVehicleSetupTool(setupPage = "") {
showTool(qsTr("Vehicle Setup"), "SetupView.qml", "/qmlimages/Gears.svg")
showTool(qsTr("Vehicle Configuration"), "SetupView.qml", "/qmlimages/Gears.svg")
if (setupPage !== "") {
toolDrawerLoader.item.showNamedComponentPanel(setupPage)
}
Expand Down Expand Up @@ -306,15 +307,14 @@ ApplicationWindow {
spacing: ScreenTools.defaultFontPixelWidth

SubMenuButton {
id: setupButton
height: toolSelectDialog._toolButtonHeight
Layout.fillWidth: true
text: qsTr("Vehicle Setup")
imageResource: "/qmlimages/Gears.svg"
text: qsTr("Plan Flight")
imageResource: "/qmlimages/Plan.svg"
onClicked: {
if (mainWindow.allowViewSwitch()) {
mainWindow.closeIndicatorDrawer()
mainWindow.showVehicleSetupTool()
mainWindow.showPlanView()
}
}
}
Expand All @@ -334,6 +334,20 @@ ApplicationWindow {
}
}

SubMenuButton {
id: setupButton
height: toolSelectDialog._toolButtonHeight
Layout.fillWidth: true
text: qsTr("Vehicle Configuration")
imageResource: "/qmlimages/Gears.svg"
onClicked: {
if (mainWindow.allowViewSwitch()) {
mainWindow.closeIndicatorDrawer()
mainWindow.showVehicleSetupTool()
}
}
}

SubMenuButton {
id: settingsButton
height: toolSelectDialog._toolButtonHeight
Expand Down Expand Up @@ -468,10 +482,10 @@ ApplicationWindow {
interactive: false
visible: false

property alias backIcon: backIcon.source
property alias toolTitle: toolbarDrawerText.text
property var backIcon
property string toolTitle
property alias toolSource: toolDrawerLoader.source
property alias toolIcon: toolIcon.source
property var toolIcon

// Unload the loader only after closed, otherwise we will see a "blank" loader in the meantime
onClosed: {
Expand All @@ -487,51 +501,27 @@ ApplicationWindow {
color: qgcPal.toolbarBackground

RowLayout {
id: toolDrawerToolbarLayout
anchors.leftMargin: ScreenTools.defaultFontPixelWidth
anchors.left: parent.left
anchors.top: parent.top
anchors.bottom: parent.bottom
spacing: ScreenTools.defaultFontPixelWidth

QGCColoredImage {
id: backIcon
width: ScreenTools.defaultFontPixelHeight * 2
height: ScreenTools.defaultFontPixelHeight * 2
fillMode: Image.PreserveAspectFit
mipmap: true
color: qgcPal.text
}

QGCLabel {
id: backTextLabel
text: qsTr("Back")
}

QGCLabel {
font.pointSize: ScreenTools.largeFontPointSize
text: "<"
}

QGCColoredImage {
id: toolIcon
width: ScreenTools.defaultFontPixelHeight * 2
height: ScreenTools.defaultFontPixelHeight * 2
fillMode: Image.PreserveAspectFit
mipmap: true
color: qgcPal.text
}

QGCLabel {
id: toolbarDrawerText
text: qsTr("Exit") + " " + toolDrawer.toolTitle
font.pointSize: ScreenTools.largeFontPointSize
}
}

QGCMouseArea {
anchors.top: parent.top
anchors.bottom: parent.bottom
x: parent.mapFromItem(backIcon, backIcon.x, backIcon.y).x
width: (backTextLabel.x + backTextLabel.width) - backIcon.x
anchors.fill: toolDrawerToolbarLayout
onClicked: {
if (mainWindow.allowViewSwitch()) {
toolDrawer.visible = false
Expand Down
2 changes: 1 addition & 1 deletion src/UI/toolbar/FlightModeIndicator.qml
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ RowLayout {

LabelledButton {
Layout.fillWidth: true
label: qsTr("RC Transmitter Flight Modes")
label: qsTr("RC Transmitter")
buttonText: qsTr("Configure")

onClicked: {
Expand Down
2 changes: 1 addition & 1 deletion src/UI/toolbar/MainStatusIndicator.qml
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ RowLayout {
}
}

QGCLabel { Layout.fillWidth: true; text: qsTr("Initial Vehicle Setup") }
QGCLabel { Layout.fillWidth: true; text: qsTr("Vehicle Configuration") }
QGCButton {
text: qsTr("Configure")
onClicked: {
Expand Down
21 changes: 14 additions & 7 deletions src/UI/toolbar/PlanViewToolBar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,25 @@ Rectangle {
anchors.bottom: parent.bottom
spacing: ScreenTools.defaultFontPixelWidth / 2

QGCToolBarButton {
id: currentButton
Layout.preferredHeight: viewButtonRow.height
icon.source: "/res/QGCLogoFull.svg"
logo: true
onClicked: mainWindow.showToolSelectDialog()
QGCLabel {
font.pointSize: ScreenTools.largeFontPointSize
text: "<"
}

QGCLabel {
text: qsTr("Exit Plan")
font.pointSize: ScreenTools.largeFontPointSize
}
}

QGCMouseArea {
anchors.fill: viewButtonRow
onClicked: mainWindow.showFlyView()
}

QGCFlickable {
id: toolsFlickable
anchors.leftMargin: ScreenTools.defaultFontPixelWidth * ScreenTools.largeFontPointRatio * 1.5
//anchors.leftMargin: ScreenTools.defaultFontPixelWidth * ScreenTools.largeFontPointRatio * 1.5
anchors.left: viewButtonRow.right
anchors.bottomMargin: 1
anchors.top: parent.top
Expand Down
Loading