diff --git a/src/FactSystem/FactControls/FactTextFieldSlider.qml b/src/FactSystem/FactControls/FactTextFieldSlider.qml index 90fa510c12cf..7a3f3fc20986 100644 --- a/src/FactSystem/FactControls/FactTextFieldSlider.qml +++ b/src/FactSystem/FactControls/FactTextFieldSlider.qml @@ -6,7 +6,7 @@ import QGroundControl import QGroundControl.Controls import QGroundControl.FactControls -ColumnLayout { +Rectangle { property alias label: factTextField.label property alias fact: factTextField.fact property alias textFieldPreferredWidth: factTextField.textFieldPreferredWidth @@ -16,15 +16,19 @@ ColumnLayout { property alias textField: factTextField property alias enableCheckBoxChecked: enableCheckbox.checked - property bool showEnableCheckbox: false ///< true: show enable/disable checkbox, false: hide + property bool showEnableCheckbox: false ///< true: show enable/disable checkbox, false: hide + property color backgroundColor: _ftfsBackgroundColor signal enableCheckboxClicked - id: control - spacing: 0 + id: control + implicitHeight: mainLayout.implicitHeight + color: backgroundColor + radius: ScreenTools.defaultBorderRadius - property bool _loadComplete: false - property bool _showSlider: fact.userMin !== undefined && fact.userMax !== undefined + property bool _loadComplete: false + property bool _showSlider: fact.userMin !== undefined && fact.userMax !== undefined + property color _ftfsBackgroundColor: Qt.rgba(qgcPal.windowShadeLight.r, qgcPal.windowShadeLight.g, qgcPal.windowShadeLight.b, 0.2) function updateSliderToClampedValue() { if (_showSlider && sliderLoader.item) { @@ -47,50 +51,58 @@ ColumnLayout { target: control.fact function onValueChanged() { - updateSliderToClampedValue() + control.updateSliderToClampedValue() } } - RowLayout { - spacing: ScreenTools.defaultFontPixelWidth + QGCPalette { id: qgcPal; colorGroupEnabled: true } - QGCCheckBox { - id: enableCheckbox - visible: control.showEnableCheckbox + ColumnLayout { + id: mainLayout + width: parent.width + spacing: 0 - onClicked: control.enableCheckboxClicked() + RowLayout { + spacing: ScreenTools.defaultFontPixelWidth + + QGCCheckBox { + id: enableCheckbox + visible: control.showEnableCheckbox + + onClicked: control.enableCheckboxClicked() + } + + LabelledFactTextField { + id: factTextField + Layout.fillWidth: true + label: control.label + fact: control.fact + enabled: !control.showEnableCheckbox || enableCheckbox.checked + } } - LabelledFactTextField { - id: factTextField + Loader { + id: sliderLoader Layout.fillWidth: true - label: control.label - fact: control.fact + sourceComponent: control._showSlider ? sliderComponent : null enabled: !control.showEnableCheckbox || enableCheckbox.checked } - } - - Loader { - id: sliderLoader - Layout.fillWidth: true - sourceComponent: control._showSlider ? sliderComponent : null - enabled: !control.showEnableCheckbox || enableCheckbox.checked - } - Component { - id: sliderComponent - - QGCSlider { - id: slider - Layout.fillWidth: true - from: control.fact.userMin - to: control.fact.userMax - mouseWheelSupport: false - showBoundaryValues: true - - onMoved: { - if (control._loadComplete) { - control.fact.value = slider.value + Component { + id: sliderComponent + + QGCSlider { + id: slider + Layout.fillWidth: true + from: control.fact.userMin + to: control.fact.userMax + mouseWheelSupport: false + showBoundaryValues: true + + onMoved: { + if (control._loadComplete) { + control.fact.value = slider.value + } } } } diff --git a/src/MissionManager/CameraSection.FactMetaData.json b/src/MissionManager/CameraSection.FactMetaData.json index c114a055868a..78a32a947812 100644 --- a/src/MissionManager/CameraSection.FactMetaData.json +++ b/src/MissionManager/CameraSection.FactMetaData.json @@ -4,60 +4,64 @@ "QGC.MetaData.Facts": [ { - "name": "CameraAction", - "shortDesc": "Specify whether the camera should take photos or video", - "type": "uint32", - "enumStrings": "No change,Take photo,Take photos (time),Take photos (distance),Stop taking photos,Start recording video,Stop recording video", - "enumValues": "0,6,1,2,3,4,5", - "default": 0 + "name": "CameraAction", + "shortDesc": "Specify whether the camera should take photos or video", + "type": "uint32", + "enumStrings": "No change,Take photo,Take photos (time),Take photos (distance),Stop taking photos,Start recording video,Stop recording video", + "enumValues": "0,6,1,2,3,4,5", + "default": 0 }, { "name": "CameraPhotoIntervalDistance", - "shortDesc": "Specify the distance between each photo", + "shortDesc": "Specify the distance between each photo", "type": "double", "units": "m", "min": 0.1, "decimalPlaces": 1, - "default": 1 + "default": 1 }, { "name": "CameraPhotoIntervalTime", - "shortDesc": "Specify the time between each photo", + "shortDesc": "Specify the time between each photo", "type": "uint32", "units": "secs", "min": 1, "decimalPlaces": 0, - "default": 10 + "default": 10 }, { "name": "GimbalPitch", - "shortDesc": "Gimbal pitch rotation.", + "shortDesc": "Gimbal pitch rotation.", "type": "double", "units": "gimbal-degrees", "min": -90, "max": 0, + "userMin": -90, + "userMax": 0, "increment": 5, "decimalPlaces": 0, - "default": 0 + "default": 0 }, { "name": "GimbalYaw", - "shortDesc": "Gimbal yaw rotation.", + "shortDesc": "Gimbal yaw rotation.", "type": "double", "units": "deg", "min": -180.0, "max": 180.0, + "userMin": -180.0, + "userMax": 180.0, "increment": 5, "decimalPlaces": 0, - "default": 0 + "default": 0 }, { - "name": "CameraMode", - "shortDesc": "Specify whether the camera should switch to Photo, Video or Survey mode", - "type": "uint32", - "enumStrings": "Photo,Video,Survey", - "enumValues": "0,1,2", - "default": 0 + "name": "CameraMode", + "shortDesc": "Specify whether the camera should switch to Photo, Video or Survey mode", + "type": "uint32", + "enumStrings": "Photo,Video,Survey", + "enumValues": "0,1,2", + "default": 0 } ] } diff --git a/src/QmlControls/CameraSection.qml b/src/QmlControls/CameraSection.qml index ad412ce691e7..5ac2e776d478 100644 --- a/src/QmlControls/CameraSection.qml +++ b/src/QmlControls/CameraSection.qml @@ -3,20 +3,16 @@ import QtQuick.Controls import QtQuick.Layouts import QGroundControl - import QGroundControl.Controls import QGroundControl.FactControls - // Camera section for mission item editors Column { - anchors.left: parent.left - anchors.right: parent.right - spacing: _margin + property alias buttonGroup: cameraSectionHeader.buttonGroup + property alias showSpacer: cameraSectionHeader.showSpacer + property alias checked: cameraSectionHeader.checked - property alias buttonGroup: cameraSectionHeader.buttonGroup - property alias showSpacer: cameraSectionHeader.showSpacer - property alias checked: cameraSectionHeader.checked + spacing: _margin property var _camera: missionItem.cameraSection property real _fieldWidth: ScreenTools.defaultFontPixelWidth * 16 @@ -24,63 +20,42 @@ Column { SectionHeader { id: cameraSectionHeader - anchors.left: parent.left - anchors.right: parent.right + width: parent.width text: qsTr("Camera") checked: false } Column { - anchors.left: parent.left - anchors.right: parent.right - spacing: _margin - visible: cameraSectionHeader.checked - - FactComboBox { - id: cameraActionCombo - anchors.left: parent.left - anchors.right: parent.right - fact: _camera.cameraAction - indexModel: false + width: parent.width + spacing: _margin + visible: cameraSectionHeader.checked + + LabelledFactComboBox { + id: cameraActionCombo + width: parent.width + label: qsTr("Action") + fact: _camera.cameraAction + indexModel: false } - RowLayout { - anchors.left: parent.left - anchors.right: parent.right - spacing: ScreenTools.defaultFontPixelWidth - visible: _camera.cameraAction.rawValue === 1 - - QGCLabel { - text: qsTr("Time") - Layout.fillWidth: true - } - FactTextField { - fact: _camera.cameraPhotoIntervalTime - Layout.preferredWidth: _fieldWidth - } + LabelledFactTextField { + width: parent.width + label: qsTr("Time") + fact: _camera.cameraPhotoIntervalTime + visible: _camera.cameraAction.rawValue === 1 } - RowLayout { - anchors.left: parent.left - anchors.right: parent.right - spacing: ScreenTools.defaultFontPixelWidth - visible: _camera.cameraAction.rawValue === 2 - - QGCLabel { - text: qsTr("Distance") - Layout.fillWidth: true - } - FactTextField { - fact: _camera.cameraPhotoIntervalDistance - Layout.preferredWidth: _fieldWidth - } + LabelledFactTextField { + width: parent.width + label: qsTr("Distance") + fact: _camera.cameraPhotoIntervalDistance + visible: _camera.cameraAction.rawValue === 2 } RowLayout { - anchors.left: parent.left - anchors.right: parent.right - spacing: ScreenTools.defaultFontPixelWidth - visible: _camera.cameraModeSupported + width: parent.width + spacing: ScreenTools.defaultFontPixelWidth + visible: _camera.cameraModeSupported QGCCheckBox { id: modeCheckBox @@ -88,6 +63,7 @@ Column { checked: _camera.specifyCameraMode onClicked: _camera.specifyCameraMode = checked } + FactComboBox { fact: _camera.cameraMode indexModel: false @@ -96,34 +72,25 @@ Column { } } - GridLayout { - anchors.left: parent.left - anchors.right: parent.right - columnSpacing: ScreenTools.defaultFontPixelWidth / 2 - rowSpacing: 0 - columns: 3 - - QGCLabel { text: qsTr("Gimbal") } - QGCLabel { text: qsTr("Pitch") } - QGCLabel { text: qsTr("Yaw") } + QGCCheckBox { + id: gimbalCheckBox + text: qsTr("Gimbal") + checked: _camera.specifyGimbal + onClicked: _camera.specifyGimbal = checked + } - QGCCheckBox { - id: gimbalCheckBox - checked: _camera.specifyGimbal - onClicked: _camera.specifyGimbal = checked - Layout.fillWidth: true - } - FactTextField { - fact: _camera.gimbalPitch - implicitWidth: ScreenTools.defaultFontPixelWidth * 9 - enabled: gimbalCheckBox.checked - } + FactTextFieldSlider { + width: parent.width + label: qsTr("Pitch") + fact: _camera.gimbalPitch + enabled: gimbalCheckBox.checked + } - FactTextField { - fact: _camera.gimbalYaw - implicitWidth: ScreenTools.defaultFontPixelWidth * 9 - enabled: gimbalCheckBox.checked - } + FactTextFieldSlider { + width: parent.width + label: qsTr("Yaw") + fact: _camera.gimbalYaw + enabled: gimbalCheckBox.checked } } } diff --git a/src/QmlControls/MissionItemEditor.qml b/src/QmlControls/MissionItemEditor.qml index ddbe9352f678..dfed01766ff9 100644 --- a/src/QmlControls/MissionItemEditor.qml +++ b/src/QmlControls/MissionItemEditor.qml @@ -69,78 +69,87 @@ Rectangle { color: "transparent" } - RowLayout { - id: bottomRowLayout + Rectangle { width: parent.width - spacing: ScreenTools.defaultFontPixelWidth - - Rectangle { - id: notReadyForSaveIndicator - Layout.preferredWidth: visible ? _hamburgerSize : 0 - Layout.preferredHeight: _hamburgerSize - border.width: 1 - border.color: qgcPal.warningText - color: "white" - radius: width / 2 - visible: !_readyForSave + height: bottomRowLayout.implicitHeight + (_verticalMargin * 2) + color: Qt.rgba(qgcPal.windowShadeLight.r, qgcPal.windowShadeLight.g, qgcPal.windowShadeLight.b, 0.2) + + property real _verticalMargin: ScreenTools.defaultFontPixelHeight / 4 + + RowLayout { + id: bottomRowLayout + y: parent._verticalMargin + width: parent.width + spacing: ScreenTools.defaultFontPixelWidth + + Rectangle { + id: notReadyForSaveIndicator + Layout.preferredWidth: visible ? _hamburgerSize : 0 + Layout.preferredHeight: _hamburgerSize + border.width: 1 + border.color: qgcPal.warningText + color: "white" + radius: width / 2 + visible: !_readyForSave - QGCLabel { - id: readyForSaveLabel - anchors.centerIn: parent - //: Indicator in Plan view to show mission item is not ready for save/send - text: qsTr("?") - color: qgcPal.warningText - font.pointSize: ScreenTools.smallFontPointSize + QGCLabel { + id: readyForSaveLabel + anchors.centerIn: parent + //: Indicator in Plan view to show mission item is not ready for save/send + text: qsTr("?") + color: qgcPal.warningText + font.pointSize: ScreenTools.smallFontPointSize + } } - } - QGCColoredImage { - id: deleteButton - Layout.preferredWidth: visible ? _hamburgerSize : 0 - Layout.preferredHeight: _hamburgerSize - Layout.fillHeight: true - source: "/res/TrashDelete.svg" - sourceSize.height: _hamburgerSize - fillMode: Image.PreserveAspectFit - mipmap: true - smooth: true - color: qgcPal.text - visible: missionItem.sequenceNumber !== 0 - - QGCMouseArea { - fillItem: parent - onClicked: remove() + QGCColoredImage { + id: deleteButton + Layout.preferredWidth: visible ? _hamburgerSize : 0 + Layout.preferredHeight: _hamburgerSize + Layout.fillHeight: true + source: "/res/TrashDelete.svg" + sourceSize.height: _hamburgerSize + fillMode: Image.PreserveAspectFit + mipmap: true + smooth: true + color: qgcPal.text + visible: missionItem.sequenceNumber !== 0 + + QGCMouseArea { + fillItem: parent + onClicked: remove() + } } - } - QGCLabel { - Layout.fillWidth: true - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - text: missionItem.commandDescription - wrapMode: Text.WordWrap - font.pointSize: ScreenTools.smallFontPointSize - } + QGCLabel { + Layout.fillWidth: true + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + text: missionItem.commandDescription + wrapMode: Text.WordWrap + font.pointSize: ScreenTools.smallFontPointSize + } - QGCColoredImage { - id: hamburger - Layout.alignment: Qt.AlignRight - Layout.preferredWidth: visible ? _hamburgerSize : 0 - Layout.preferredHeight: _hamburgerSize - sourceSize.height: _hamburgerSize - source: "qrc:/qmlimages/Hamburger.svg" - color: qgcPal.text - visible: missionItem.sequenceNumber !== 0 - - QGCMouseArea { - fillItem: hamburger - - onClicked: (position) => { - position = Qt.point(position.x, position.y) - // For some strange reason using mainWindow in mapToItem doesn't work, so we use globals.parent instead which also gets us mainWindow - position = mapToItem(globals.parent, position) - var dropPanel = hamburgerMenuDropPanelComponent.createObject(mainWindow, { clickRect: Qt.rect(position.x, position.y, 0, 0) }) - dropPanel.open() + QGCColoredImage { + id: hamburger + Layout.alignment: Qt.AlignRight + Layout.preferredWidth: visible ? _hamburgerSize : 0 + Layout.preferredHeight: _hamburgerSize + sourceSize.height: _hamburgerSize + source: "qrc:/qmlimages/Hamburger.svg" + color: qgcPal.text + visible: missionItem.sequenceNumber !== 0 + + QGCMouseArea { + fillItem: hamburger + + onClicked: (position) => { + position = Qt.point(position.x, position.y) + // For some strange reason using mainWindow in mapToItem doesn't work, so we use globals.parent instead which also gets us mainWindow + position = mapToItem(globals.parent, position) + var dropPanel = hamburgerMenuDropPanelComponent.createObject(mainWindow, { clickRect: Qt.rect(position.x, position.y, 0, 0) }) + dropPanel.open() + } } } } diff --git a/src/QmlControls/MissionSettingsEditor.qml b/src/QmlControls/MissionSettingsEditor.qml index 93d79631bb53..0ce1a6736d5f 100644 --- a/src/QmlControls/MissionSettingsEditor.qml +++ b/src/QmlControls/MissionSettingsEditor.qml @@ -146,8 +146,9 @@ Rectangle { CameraSection { id: cameraSection - checked: !_waypointsOnlyMode && missionItem.cameraSection.settingsSpecified visible: _showCameraSection + + Component.onCompleted: checked = !_waypointsOnlyMode && missionItem.cameraSection.settingsSpecified } QGCLabel { diff --git a/src/QmlControls/QGCButton.qml b/src/QmlControls/QGCButton.qml index b0eb9e71c861..8ce3bde8f609 100644 --- a/src/QmlControls/QGCButton.qml +++ b/src/QmlControls/QGCButton.qml @@ -22,7 +22,7 @@ Button { property bool primary: false ///< primary button for a group of buttons property bool showBorder: qgcPal.globalTheme === QGCPalette.Light - property real backRadius: ScreenTools.buttonBorderRadius + property real backRadius: ScreenTools.defaultBorderRadius property real heightFactor: 0.5 property string iconSource: "" property real fontWeight: Font.Normal // default for qml Text diff --git a/src/QmlControls/QGCCheckBox.qml b/src/QmlControls/QGCCheckBox.qml index ab1822603919..f1dede996790 100644 --- a/src/QmlControls/QGCCheckBox.qml +++ b/src/QmlControls/QGCCheckBox.qml @@ -9,10 +9,10 @@ CheckBox { id: control spacing: _noText ? 0 : ScreenTools.defaultFontPixelWidth focusPolicy: Qt.ClickFocus + leftPadding: 0 Component.onCompleted: { if (_noText) { - leftPadding = 0 rightPadding = 0 } } @@ -52,7 +52,7 @@ CheckBox { color: control.enabled ? "white" : "transparent" border.color: qgcPal.buttonBorder border.width: 1 - radius: ScreenTools.buttonBorderRadius + radius: ScreenTools.defaultBorderRadius opacity: control.checkedState === Qt.PartiallyChecked ? 0.5 : 1 QGCColoredImage { diff --git a/src/QmlControls/QGCComboBox.qml b/src/QmlControls/QGCComboBox.qml index e784ba3b8d66..4eaa36ba8dca 100644 --- a/src/QmlControls/QGCComboBox.qml +++ b/src/QmlControls/QGCComboBox.qml @@ -125,7 +125,7 @@ T.ComboBox { color: qgcPal.button border.color: qgcPal.buttonBorder border.width: _showBorder ? 1 : 0 - radius: ScreenTools.buttonBorderRadius + radius: ScreenTools.defaultBorderRadius } popup: T.Popup { diff --git a/src/QmlControls/QGCDelayButton.qml b/src/QmlControls/QGCDelayButton.qml index 420e55ba2b97..4f859432fe75 100644 --- a/src/QmlControls/QGCDelayButton.qml +++ b/src/QmlControls/QGCDelayButton.qml @@ -17,7 +17,7 @@ DelayButton { delay: defaultDelay property bool showBorder: qgcPal.globalTheme === QGCPalette.Light - property real backRadius: ScreenTools.buttonBorderRadius + property real backRadius: ScreenTools.defaultBorderRadius property real heightFactor: 0.5 property real fontWeight: Font.Normal // default for qml Text property real pointSize: ScreenTools.defaultFontPointSize diff --git a/src/QmlControls/QGCTabButton.qml b/src/QmlControls/QGCTabButton.qml index 22bcc30fecd1..6d6637ba5daa 100644 --- a/src/QmlControls/QGCTabButton.qml +++ b/src/QmlControls/QGCTabButton.qml @@ -27,7 +27,7 @@ TabButton { property bool primary: false ///< primary button for a group of buttons property real pointSize: ScreenTools.defaultFontPointSize ///< Point size for button text property bool showBorder: qgcPal.globalTheme === QGCPalette.Light - property real backRadius: ScreenTools.buttonBorderRadius + property real backRadius: ScreenTools.defaultBorderRadius property real heightFactor: 0.5 property bool _showHighlight: enabled && (pressed | checked) diff --git a/src/QmlControls/QGCTextField.qml b/src/QmlControls/QGCTextField.qml index f97926c2277d..e858cf806649 100644 --- a/src/QmlControls/QGCTextField.qml +++ b/src/QmlControls/QGCTextField.qml @@ -86,7 +86,7 @@ TextField { background: Rectangle { border.width: control.validationError ? 2 : (qgcPal.globalTheme === QGCPalette.Light ? 1 : 0) border.color: control.validationError ? qgcPal.colorRed : qgcPal.buttonBorder - radius: ScreenTools.buttonBorderRadius + radius: ScreenTools.defaultBorderRadius color: qgcPal.textField implicitWidth: ScreenTools.implicitTextFieldWidth implicitHeight: ScreenTools.implicitTextFieldHeight diff --git a/src/QmlControls/ScreenTools.qml b/src/QmlControls/ScreenTools.qml index ffca7f8ee30e..82e72235483a 100644 --- a/src/QmlControls/ScreenTools.qml +++ b/src/QmlControls/ScreenTools.qml @@ -64,7 +64,6 @@ Item { property real toolbarHeight: 0 - property real realPixelDensity: { //-- If a plugin defines it, just use what it tells us if(QGroundControl.corePlugin.options.devicePixelDensity != 0) { @@ -114,7 +113,7 @@ Item { property real implicitComboBoxWidth: Math.round(defaultFontPixelWidth * (isMobile ? 7.0 : 5.0)) property real comboBoxPadding: defaultFontPixelWidth property real implicitSliderHeight: isMobile ? Math.max(defaultFontPixelHeight, minTouchPixels) : defaultFontPixelHeight - property real buttonBorderRadius: defaultFontPixelWidth / 2 + property real defaultBorderRadius: defaultFontPixelWidth / 2 // It's not possible to centralize an even number of pixels, checkBoxIndicatorSize should be an odd number to allow centralization property real checkBoxIndicatorSize: 2 * Math.floor(defaultFontPixelHeight * (isMobile ? 1.5 : 1.0) / 2) + 1 property real radioButtonIndicatorSize: checkBoxIndicatorSize diff --git a/src/QmlControls/SimpleItemEditor.qml b/src/QmlControls/SimpleItemEditor.qml index b4b538526c9c..13f64439321d 100644 --- a/src/QmlControls/SimpleItemEditor.qml +++ b/src/QmlControls/SimpleItemEditor.qml @@ -50,18 +50,15 @@ Rectangle { Component { id: altModeDialogComponent; AltModeDialog { } } Column { - id: editorColumn - anchors.left: parent.left - anchors.right: parent.right - anchors.top: parent.top - spacing: _margin + id: editorColumn + width: parent.width + spacing: _margin // Takeoff item ColumnLayout { - anchors.left: parent.left - anchors.right: parent.right - spacing: _margin - visible: missionItem.isTakeoffItem && missionItem.wizardMode // Hack special case for takeoff item + width: parent.width + spacing: _margin + visible: missionItem.isTakeoffItem && missionItem.wizardMode // Hack special case for takeoff item QGCLabel { text: qsTr("Move '%1' %2 to the %3 location. %4") @@ -102,16 +99,14 @@ Rectangle { } Column { - anchors.left: parent.left - anchors.right: parent.right - spacing: _fieldSpacing - visible: !missionItem.wizardMode + width: parent.width + spacing: _fieldSpacing + visible: !missionItem.wizardMode ColumnLayout { - anchors.left: parent.left - anchors.right: parent.right - spacing: 0 - visible: _specifiesAltitude + width: parent.width + spacing: 0 + visible: _specifiesAltitude QGCLabel { Layout.fillWidth: true @@ -172,16 +167,9 @@ Rectangle { } } - Rectangle { - height: 1 - width: parent.width - color: qgcPal.windowShadeLight - } - ColumnLayout { - anchors.left: parent.left - anchors.right: parent.right - spacing: _margin + width: parent.width + spacing: _margin Repeater { model: missionItem.comboboxFacts @@ -209,60 +197,30 @@ Rectangle { Repeater { model: missionItem.textFieldFacts - ColumnLayout { - width: parent.width - spacing: _fieldSpacing - - FactTextFieldSlider { - Layout.fillWidth: true - label: object.name - fact: object - enabled: !object.readOnly - } - - Rectangle { - Layout.fillWidth: true - height: 1 - color: qgcPal.windowShadeLight - } + FactTextFieldSlider { + width: parent.width + label: object.name + fact: object + enabled: !object.readOnly } } Repeater { model: missionItem.nanFacts - ColumnLayout { - width: parent.width - spacing: _fieldSpacing - - FactTextFieldSlider { - Layout.fillWidth: true - label: object.name - fact: object - showEnableCheckbox: true - enableCheckBoxChecked: !isNaN(object.rawValue) - - onEnableCheckboxClicked: object.rawValue = enableCheckBoxChecked ? 0 : NaN - } + FactTextFieldSlider { + width: parent.width + label: object.name + fact: object + showEnableCheckbox: true + enableCheckBoxChecked: !isNaN(object.rawValue) - Rectangle { - Layout.fillWidth: true - height: 1 - color: qgcPal.windowShadeLight - } + onEnableCheckboxClicked: object.rawValue = enableCheckBoxChecked ? 0 : NaN } } - Rectangle { - height: 1 - width: parent.width - color: qgcPal.windowShadeLight - visible: missionItem.textFieldFacts.count === 0 && missionItem.nanFacts.count === 0 - } - FactTextFieldSlider { - anchors.left: parent.left - anchors.right: parent.right + width: parent.width label: qsTr("Flight Speed") fact: missionItem.speedSection.flightSpeed showEnableCheckbox: true @@ -273,8 +231,10 @@ Rectangle { } CameraSection { - checked: missionItem.cameraSection.settingsSpecified + width: parent.width visible: missionItem.cameraSection.available + + Component.onCompleted: checked = missionItem.cameraSection.settingsSpecified } } }