From 1067b01f7a8b9a2c8342b175d0f8ba25bf8582c3 Mon Sep 17 00:00:00 2001 From: DonLakeFlyer Date: Mon, 11 Nov 2019 06:07:43 -0800 Subject: [PATCH] SectionHeader no longer set width automatically --- src/PlanView/CameraSection.qml | 2 ++ src/PlanView/CorridorScanEditor.qml | 20 +++++++++++------- src/PlanView/FWLandingPatternEditor.qml | 20 +++++++++++------- src/PlanView/GeoFenceEditor.qml | 24 ++++++++++++++------- src/PlanView/MissionSettingsEditor.qml | 28 +++++++++++++++---------- src/PlanView/StructureScanEditor.qml | 12 +++++++---- src/PlanView/SurveyItemEditor.qml | 28 +++++++++++++------------ src/QmlControls/ParameterEditor.qml | 2 ++ src/QmlControls/PreFlightCheckGroup.qml | 6 ++++-- src/QmlControls/SectionHeader.qml | 6 ++---- 10 files changed, 92 insertions(+), 56 deletions(-) diff --git a/src/PlanView/CameraSection.qml b/src/PlanView/CameraSection.qml index 0a01e62e0..fc588b18a 100644 --- a/src/PlanView/CameraSection.qml +++ b/src/PlanView/CameraSection.qml @@ -24,6 +24,8 @@ Column { SectionHeader { id: cameraSectionHeader + anchors.left: parent.left + anchors.right: parent.right text: qsTr("Camera") checked: false } diff --git a/src/PlanView/CorridorScanEditor.qml b/src/PlanView/CorridorScanEditor.qml index 86058e936..3ccfe084b 100644 --- a/src/PlanView/CorridorScanEditor.qml +++ b/src/PlanView/CorridorScanEditor.qml @@ -124,8 +124,10 @@ Rectangle { } SectionHeader { - id: corridorHeader - text: qsTr("Corridor") + id: corridorHeader + anchors.left: parent.left + anchors.right: parent.right + text: qsTr("Corridor") } GridLayout { @@ -182,9 +184,11 @@ Rectangle { } SectionHeader { - id: terrainHeader - text: qsTr("Terrain") - checked: missionItem.followTerrain + id: terrainHeader + anchors.left: parent.left + anchors.right: parent.right + text: qsTr("Terrain") + checked: missionItem.followTerrain } ColumnLayout { @@ -228,8 +232,10 @@ Rectangle { } SectionHeader { - id: statsHeader - text: qsTr("Statistics") + id: statsHeader + anchors.left: parent.left + anchors.right: parent.right + text: qsTr("Statistics") } TransectStyleComplexItemStats { } diff --git a/src/PlanView/FWLandingPatternEditor.qml b/src/PlanView/FWLandingPatternEditor.qml index 44a1493d7..f69c81e08 100644 --- a/src/PlanView/FWLandingPatternEditor.qml +++ b/src/PlanView/FWLandingPatternEditor.qml @@ -52,8 +52,10 @@ Rectangle { visible: !editorColumnNeedLandingPoint.visible SectionHeader { - id: loiterPointSection - text: qsTr("Loiter point") + id: loiterPointSection + anchors.left: parent.left + anchors.right: parent.right + text: qsTr("Loiter point") } Column { @@ -101,8 +103,10 @@ Rectangle { } SectionHeader { - id: landingPointSection - text: qsTr("Landing point") + id: landingPointSection + anchors.left: parent.left + anchors.right: parent.right + text: qsTr("Landing point") } Column { @@ -181,9 +185,11 @@ Rectangle { } SectionHeader { - id: cameraSection - text: qsTr("Camera") - visible: _showCameraSection + id: cameraSection + anchors.left: parent.left + anchors.right: parent.right + text: qsTr("Camera") + visible: _showCameraSection } Column { diff --git a/src/PlanView/GeoFenceEditor.qml b/src/PlanView/GeoFenceEditor.qml index 40bfa0e62..667b6d37d 100644 --- a/src/PlanView/GeoFenceEditor.qml +++ b/src/PlanView/GeoFenceEditor.qml @@ -110,8 +110,10 @@ QGCFlickable { } SectionHeader { - id: insertSection - text: qsTr("Insert GeoFence") + id: insertSection + anchors.left: parent.left + anchors.right: parent.right + text: qsTr("Insert GeoFence") } QGCButton { @@ -139,8 +141,10 @@ QGCFlickable { } SectionHeader { - id: polygonSection - text: qsTr("Polygon Fences") + id: polygonSection + anchors.left: parent.left + anchors.right: parent.right + text: qsTr("Polygon Fences") } QGCLabel { @@ -212,8 +216,10 @@ QGCFlickable { } // GridLayout SectionHeader { - id: circleSection - text: qsTr("Circular Fences") + id: circleSection + anchors.left: parent.left + anchors.right: parent.right + text: qsTr("Circular Fences") } QGCLabel { @@ -302,8 +308,10 @@ QGCFlickable { } // GridLayout SectionHeader { - id: breachReturnSection - text: qsTr("Breach Return Point") + id: breachReturnSection + anchors.left: parent.left + anchors.right: parent.right + text: qsTr("Breach Return Point") } QGCButton { diff --git a/src/PlanView/MissionSettingsEditor.qml b/src/PlanView/MissionSettingsEditor.qml index 3efe77fc9..4c6f5095a 100644 --- a/src/PlanView/MissionSettingsEditor.qml +++ b/src/PlanView/MissionSettingsEditor.qml @@ -108,9 +108,11 @@ Rectangle { } SectionHeader { - id: missionEndHeader - text: qsTr("Mission End") - checked: true + id: missionEndHeader + anchors.left: parent.left + anchors.right: parent.right + text: qsTr("Mission End") + checked: true } Column { @@ -128,10 +130,12 @@ Rectangle { SectionHeader { - id: vehicleInfoSectionHeader - text: qsTr("Vehicle Info") - visible: _offlineEditing && !_waypointsOnlyMode - checked: false + id: vehicleInfoSectionHeader + anchors.left: parent.left + anchors.right: parent.right + text: qsTr("Vehicle Info") + visible: _offlineEditing && !_waypointsOnlyMode + checked: false } GridLayout { @@ -192,10 +196,12 @@ Rectangle { } // GridLayout SectionHeader { - id: plannedHomePositionSection - text: qsTr("Planned Home Position") - visible: !_vehicleHasHomePosition - checked: false + id: plannedHomePositionSection + anchors.left: parent.left + anchors.right: parent.right + text: qsTr("Planned Home Position") + visible: !_vehicleHasHomePosition + checked: false } Column { diff --git a/src/PlanView/StructureScanEditor.qml b/src/PlanView/StructureScanEditor.qml index 31e307ef6..c8a861147 100644 --- a/src/PlanView/StructureScanEditor.qml +++ b/src/PlanView/StructureScanEditor.qml @@ -130,8 +130,10 @@ Rectangle { } SectionHeader { - id: scanHeader - text: qsTr("Scan") + id: scanHeader + anchors.left: parent.left + anchors.right: parent.right + text: qsTr("Scan") } Column { @@ -200,8 +202,10 @@ Rectangle { } // Column - Scan SectionHeader { - id: statsHeader - text: qsTr("Statistics") + id: statsHeader + anchors.left: parent.left + anchors.right: parent.right + text: qsTr("Statistics") } Grid { diff --git a/src/PlanView/SurveyItemEditor.qml b/src/PlanView/SurveyItemEditor.qml index 291dd8680..c2fcf07e6 100644 --- a/src/PlanView/SurveyItemEditor.qml +++ b/src/PlanView/SurveyItemEditor.qml @@ -124,8 +124,10 @@ Rectangle { } SectionHeader { - id: transectsHeader - text: qsTr("Transects") + id: transectsHeader + anchors.left: parent.left + anchors.right: parent.right + text: qsTr("Transects") } GridLayout { @@ -233,9 +235,11 @@ Rectangle { } SectionHeader { - id: terrainHeader - text: qsTr("Terrain") - checked: missionItem.followTerrain + id: terrainHeader + anchors.left: parent.left + anchors.right: parent.right + text: qsTr("Terrain") + checked: missionItem.followTerrain } ColumnLayout { @@ -280,8 +284,10 @@ Rectangle { } SectionHeader { - id: statsHeader - text: qsTr("Statistics") + id: statsHeader + anchors.left: parent.left + anchors.right: parent.right + text: qsTr("Statistics") } TransectStyleComplexItemStats { @@ -357,8 +363,6 @@ Rectangle { SectionHeader { id: presectsTransectsHeader - anchors.left: undefined - anchors.right: undefined Layout.fillWidth: true text: qsTr("Transects") } @@ -400,11 +404,9 @@ Rectangle { } SectionHeader { - id: presetsStatsHeader - anchors.left: undefined - anchors.right: undefined + id: presetsStatsHeader Layout.fillWidth: true - text: qsTr("Statistics") + text: qsTr("Statistics") } TransectStyleComplexItemStats { diff --git a/src/QmlControls/ParameterEditor.qml b/src/QmlControls/ParameterEditor.qml index 811f26192..4095eb157 100644 --- a/src/QmlControls/ParameterEditor.qml +++ b/src/QmlControls/ParameterEditor.qml @@ -174,6 +174,8 @@ Item { SectionHeader { id: categoryHeader + anchors.left: parent.left + anchors.right: parent.right text: category checked: controller.currentCategory === text exclusiveGroup: sectionGroup diff --git a/src/QmlControls/PreFlightCheckGroup.qml b/src/QmlControls/PreFlightCheckGroup.qml index f3d2b3fee..19280ba8d 100644 --- a/src/QmlControls/PreFlightCheckGroup.qml +++ b/src/QmlControls/PreFlightCheckGroup.qml @@ -43,8 +43,10 @@ Column { } SectionHeader { - id: header - text: name + (passed ? qsTr(" (passed)") : "") + id: header + anchors.left: parent.left + anchors.right: parent.right + text: name + (passed ? qsTr(" (passed)") : "") } Column { diff --git a/src/QmlControls/SectionHeader.qml b/src/QmlControls/SectionHeader.qml index 06c9a2ca5..dc763f2e3 100644 --- a/src/QmlControls/SectionHeader.qml +++ b/src/QmlControls/SectionHeader.qml @@ -7,10 +7,8 @@ import QGroundControl.ScreenTools 1.0 import QGroundControl.Palette 1.0 FocusScope { - id: _root - anchors.left: parent.left - anchors.right: parent.right - height: column.height + id: _root + height: column.height property alias text: label.text property bool checked: true -- 2.22.0