Skip to content
MainToolBarIndicators.qml 1.96 KiB
Newer Older
/****************************************************************************
 *
Gus Grubba's avatar
Gus Grubba committed
 * (c) 2009-2020 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.
 *
 ****************************************************************************/
dogmaphobic's avatar
dogmaphobic committed

DoinLakeFlyer's avatar
 
DoinLakeFlyer committed
import QtQuick 2.12
dogmaphobic's avatar
dogmaphobic committed

DoinLakeFlyer's avatar
 
DoinLakeFlyer committed
import QGroundControl               1.0
import QGroundControl.ScreenTools   1.0
dogmaphobic's avatar
dogmaphobic committed

Don Gagne's avatar
 
Don Gagne committed
//-------------------------------------------------------------------------
//-- Toolbar Indicators
Row {
    id:                 indicatorRow
    anchors.top:        parent.top
    anchors.bottom:     parent.bottom
DoinLakeFlyer's avatar
 
DoinLakeFlyer committed
    anchors.margins:    _toolIndicatorMargins
Don Gagne's avatar
 
Don Gagne committed
    spacing:            ScreenTools.defaultFontPixelWidth * 1.5

DoinLakeFlyer's avatar
 
DoinLakeFlyer committed
    // This property should come in from the Loader
    //property bool showModeIndicators: true

    property var  _activeVehicle:           QGroundControl.multiVehicleManager.activeVehicle
    property real _toolIndicatorMargins:    ScreenTools.defaultFontPixelHeight * 0.66

    Repeater {
        id:     appRepeater
        model:  QGroundControl.corePlugin.toolBarIndicators
        Loader {
            anchors.top:        parent.top
            anchors.bottom:     parent.bottom
            source:             modelData
            visible:            item.showIndicator
        }
    }

    Repeater {
        model: _activeVehicle ? _activeVehicle.toolIndicators : []
        Loader {
            anchors.top:        parent.top
            anchors.bottom:     parent.bottom
            source:             modelData
            visible:            item.showIndicator
        }
    }

Don Gagne's avatar
 
Don Gagne committed
    Repeater {
DoinLakeFlyer's avatar
 
DoinLakeFlyer committed
        model: _activeVehicle && showModeIndicators ? _activeVehicle.modeIndicators : []
Don Gagne's avatar
 
Don Gagne committed
        Loader {
            anchors.top:        parent.top
            anchors.bottom:     parent.bottom
            source:             modelData
            visible:            item.showIndicator
Don Gagne's avatar
Don Gagne committed
        }