CustomMainToolBarIndicators.qml 3.67 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
/****************************************************************************
 *
 * (c) 2009-2019 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
 *
 * QGroundControl is licensed according to the terms in the file
 * COPYING.md in the root of the source code directory.
 *
 * @file
 *   @author Gus Grubba <gus@auterion.com>
 */

import QtQuick          2.11
import QtQuick.Controls 2.4
import QtQuick.Dialogs  1.3
import QtQuick.Layouts  1.11

import QGroundControl                       1.0
import QGroundControl.Controls              1.0
import QGroundControl.MultiVehicleManager   1.0
import QGroundControl.ScreenTools           1.0
import QGroundControl.Palette               1.0

Item {
    anchors.fill: parent
    readonly property real _indicatorMargins: ScreenTools.defaultFontPixelHeight * 0.75
    //-------------------------------------------------------------------------
    //-- Waiting for a vehicle
    Row {
        id:                         waitForVehicle
        spacing:                    ScreenTools.defaultFontPixelWidth
        visible:                    !activeVehicle
        anchors.top:                parent.top
        anchors.bottom:             parent.bottom
        anchors.left:               parent.left
        QGCColoredImage {
            id:                     menuEdge
37
            visible:                !QGroundControl.supportsPairing || !QGroundControl.settingsManager.appSettings.usePairing.rawValue
38 39 40 41 42 43 44 45 46
            anchors.verticalCenter: parent.verticalCenter
            height:                 ScreenTools.defaultFontPixelHeight
            width:                  height
            sourceSize.height:      parent.height
            fillMode:               Image.PreserveAspectFit
            source:                 "/qmlimages/PaperPlane.svg"
            color:                  qgcPal.buttonText
        }
        QGCLabel {
47
            visible:                menuEdge.visible
48 49 50 51 52
            anchors.verticalCenter: parent.verticalCenter
            text:                   qsTr("Waiting for a vehicle")
            font.pointSize:         ScreenTools.mediumFontPointSize
            font.family:            ScreenTools.demiboldFontFamily
        }
Gus Grubba's avatar
Gus Grubba committed
53
        Loader {
54
            visible:                !menuEdge.visible
Gus Grubba's avatar
Gus Grubba committed
55 56 57 58 59
            anchors.top:            parent.top
            anchors.bottom:         parent.bottom
            anchors.margins:        _indicatorMargins
            source:                 "/toolbar/PairingIndicator.qml"
        }
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
    }
    //-------------------------------------------------------------------------
    //-- Toolbar Indicators
    Row {
        id:                         indicatorRow
        anchors.top:                parent.top
        anchors.bottom:             parent.bottom
        anchors.right:              parent.right
        anchors.rightMargin:        ScreenTools.defaultFontPixelWidth * 2
        spacing:                    ScreenTools.defaultFontPixelWidth * 2
        visible:                    activeVehicle && !communicationLost
        Repeater {
            model:                  activeVehicle ? activeVehicle.toolBarIndicators : []
            Loader {
                anchors.top:        parent.top
                anchors.bottom:     parent.bottom
                anchors.margins:    _indicatorMargins
                source:             modelData;
            }
        }
        Item {
            width:                  1
            height:                 1
        }
        Loader {
            anchors.top:            parent.top
            anchors.bottom:         parent.bottom
            anchors.margins:        _indicatorMargins
            source:                 "/toolbar/MessageIndicator.qml"
        }
    }
}