SafeAreaEditor.qml 1.17 KB
Newer Older
1 2 3 4 5 6 7 8 9
import QtQuick          2.3
import QtQuick.Controls 1.2
import QtQuick.Layouts  1.2

import QGroundControl               1.0
import QGroundControl.ScreenTools   1.0
import QGroundControl.Controls      1.0
import QGroundControl.FactControls  1.0

10 11 12 13 14
GridLayout {
    id:                 editorColumn
    columns: 2
    columnSpacing: _margin
    rowSpacing: _margin
15 16
    width:      availableWidth

17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
    property var geoArea: undefined
    property int availableWidth

    property real _margin: ScreenTools.defaultFontPixelWidth / 2

    Component.onCompleted: {
        console.assert(geoArea !== undefined, "please set the areaItem property")
    }

    SectionHeader {
        id:     statsHeader
        text:   qsTr("Statistics")
        Layout.fillWidth: true
        Layout.columnSpan: 2
    }

    GridLayout {
        columns: 2
        columnSpacing: _margin
        rowSpacing: _margin
        visible:        statsHeader.checked
        Layout.fillWidth: true
        Layout.columnSpan: 2

        QGCLabel { text: qsTr("Area") }
        //QGCLabel { text: QGroundControl.squareMetersToAppSettingsAreaUnits(geoArea.area).toFixed(2) + " " + QGroundControl.appSettingsAreaUnitsString }
    }
}