AirspaceControl.qml 27 KB
Newer Older
Gus Grubba's avatar
Gus Grubba committed
1 2 3 4 5 6
import QtQuick                  2.3
import QtQuick.Controls         1.2
import QtQuick.Controls.Styles  1.4
import QtQuick.Dialogs          1.2
import QtQuick.Layouts          1.2
import QtQml                    2.2
7
import QtGraphicalEffects       1.0
Gus Grubba's avatar
Gus Grubba committed
8 9

import QGroundControl               1.0
10 11
import QGroundControl.Airmap        1.0
import QGroundControl.Airspace      1.0
Gus Grubba's avatar
Gus Grubba committed
12 13 14
import QGroundControl.Controls      1.0
import QGroundControl.FactControls  1.0
import QGroundControl.Palette       1.0
15 16
import QGroundControl.ScreenTools   1.0
import QGroundControl.Vehicle       1.0
Gus Grubba's avatar
Gus Grubba committed
17 18 19 20

Item {
    id:     _root
    width:  parent.width
Gus Grubba's avatar
Gus Grubba committed
21
    height: _colapsed ? colapsedRect.height : expandedRect.height
Gus Grubba's avatar
Gus Grubba committed
22

Gus Grubba's avatar
Gus Grubba committed
23 24
    property bool   showColapse:        true

25 26 27
    property color  _airspaceColor:     _validAdvisories ? getAispaceColor(QGroundControl.airspaceManager.advisories.airspaceColor) : _colorGray
    property bool   _validRules:        QGroundControl.airspaceManager.ruleSets.valid
    property bool   _validAdvisories:   QGroundControl.airspaceManager.advisories.valid
28
    property color  _textColor:         qgcPal.text
29
    property bool   _colapsed:          !QGroundControl.airspaceManager.airspaceVisible
Gus Grubba's avatar
Gus Grubba committed
30 31 32 33 34 35

    readonly property real      _radius:            ScreenTools.defaultFontPixelWidth * 0.5
    readonly property color     _colorOrange:       "#d75e0d"
    readonly property color     _colorBrown:        "#3c2b24"
    readonly property color     _colorLightBrown:   "#5a4e49"
    readonly property color     _colorGray:         "#615c61"
36
    readonly property color     _colorLightGray:    "#a0a0a0"
Gus Grubba's avatar
Gus Grubba committed
37 38 39
    readonly property color     _colorMidBrown:     "#3a322f"
    readonly property color     _colorYellow:       "#d7c61d"
    readonly property color     _colorWhite:        "#ffffff"
Gus Grubba's avatar
Gus Grubba committed
40 41
    readonly property color     _colorRed:          "#aa1200"
    readonly property color     _colorGreen:        "#125f00"
Gus Grubba's avatar
Gus Grubba committed
42 43 44 45 46 47

    QGCPalette {
        id: qgcPal
        colorGroupEnabled: enabled
    }

Gus Grubba's avatar
Gus Grubba committed
48 49 50 51 52 53 54 55
    function getAispaceColor(color) {
        if(color === AirspaceAdvisoryProvider.Green)  return _colorGreen;
        if(color === AirspaceAdvisoryProvider.Yellow) return _colorYellow;
        if(color === AirspaceAdvisoryProvider.Orange) return _colorOrange;
        if(color === AirspaceAdvisoryProvider.Red)    return _colorRed;
        return _colorGray;
    }

56 57
    on_AirspaceColorChanged: {
       if(_validAdvisories) {
58
           if(QGroundControl.airspaceManager.advisories.airspaceColor === AirspaceAdvisoryProvider.Yellow) {
59 60 61 62 63 64 65
               _textColor = "#000000"
               return
           }
       }
       _textColor = _colorWhite
    }

Gus Grubba's avatar
Gus Grubba committed
66 67 68 69 70
    //---------------------------------------------------------------
    //-- Colapsed State
    Rectangle {
        id:         colapsedRect
        width:      parent.width
Gus Grubba's avatar
Gus Grubba committed
71
        height:     _colapsed ? colapsedRow.height + ScreenTools.defaultFontPixelHeight : 0
72
        color:      _validAdvisories ? getAispaceColor(QGroundControl.airspaceManager.advisories.airspaceColor) : _colorGray
Gus Grubba's avatar
Gus Grubba committed
73
        radius:     _radius
Gus Grubba's avatar
Gus Grubba committed
74
        visible:    _colapsed
Gus Grubba's avatar
Gus Grubba committed
75 76 77 78 79 80 81 82 83 84
        Row {
            id:                     colapsedRow
            spacing:                ScreenTools.defaultFontPixelWidth
            anchors.left:           parent.left
            anchors.leftMargin:     ScreenTools.defaultFontPixelWidth
            anchors.verticalCenter: parent.verticalCenter
            QGCColoredImage {
                width:                  height
                height:                 ScreenTools.defaultFontPixelWidth * 2.5
                sourceSize.height:      height
85 86
                source:                 "qrc:/airmap/advisory-icon.svg"
                color:                  _textColor
Gus Grubba's avatar
Gus Grubba committed
87 88
                anchors.verticalCenter: parent.verticalCenter
            }
89 90
            Column {
                spacing:                0
Gus Grubba's avatar
Gus Grubba committed
91
                anchors.verticalCenter: parent.verticalCenter
92 93 94 95 96 97 98 99 100 101
                QGCLabel {
                    text:               qsTr("Airspace")
                    color:              _textColor
                }
                QGCLabel {
                    text:               _validAdvisories ? QGroundControl.airspaceManager.advisories.advisories.count + qsTr(" Advisories") : ""
                    color:              _textColor
                    visible:            _validAdvisories
                    font.pointSize:     ScreenTools.smallFontPointSize
                }
Gus Grubba's avatar
Gus Grubba committed
102
            }
Gus Grubba's avatar
Gus Grubba committed
103 104 105 106 107
            Item {
                width:  ScreenTools.defaultFontPixelWidth
                height: 1
            }
            AirspaceWeather {
108 109 110
                iconHeight:             ScreenTools.defaultFontPixelHeight * 2
                visible:                QGroundControl.airspaceManager.weatherInfo.valid
                contentColor:           _textColor
Gus Grubba's avatar
Gus Grubba committed
111 112
                anchors.verticalCenter: parent.verticalCenter
            }
Gus Grubba's avatar
Gus Grubba committed
113
        }
Gus Grubba's avatar
Gus Grubba committed
114 115 116 117 118
        QGCColoredImage {
            width:                  height
            height:                 ScreenTools.defaultFontPixelWidth * 2.5
            sourceSize.height:      height
            source:                 "qrc:/airmap/expand.svg"
119
            color:                  _textColor
Gus Grubba's avatar
Gus Grubba committed
120 121 122 123
            anchors.right:          parent.right
            anchors.rightMargin:    ScreenTools.defaultFontPixelWidth
            anchors.verticalCenter: parent.verticalCenter
        }
Gus Grubba's avatar
Gus Grubba committed
124 125
        MouseArea {
            anchors.fill:   parent
Gus Grubba's avatar
Gus Grubba committed
126
            onClicked:  {
127
                QGroundControl.airspaceManager.airspaceVisible = true
Gus Grubba's avatar
Gus Grubba committed
128
            }
Gus Grubba's avatar
Gus Grubba committed
129 130 131 132 133 134 135
        }
    }
    //---------------------------------------------------------------
    //-- Expanded State
    Rectangle {
        id:         expandedRect
        width:      parent.width
Gus Grubba's avatar
Gus Grubba committed
136
        height:     !_colapsed ? expandedCol.height + ScreenTools.defaultFontPixelHeight : 0
137
        color:      _validAdvisories ? getAispaceColor(QGroundControl.airspaceManager.advisories.airspaceColor) : _colorGray
Gus Grubba's avatar
Gus Grubba committed
138
        radius:     _radius
Gus Grubba's avatar
Gus Grubba committed
139
        visible:    !_colapsed
Gus Grubba's avatar
Gus Grubba committed
140 141 142 143 144 145
        MouseArea {
            anchors.fill:   parent
            onWheel:        { wheel.accepted = true; }
            onPressed:      { mouse.accepted = true; }
            onReleased:     { mouse.accepted = true; }
        }
Gus Grubba's avatar
Gus Grubba committed
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166
        Column {
            id:                     expandedCol
            spacing:                ScreenTools.defaultFontPixelHeight * 0.5
            anchors.left:           parent.left
            anchors.right:          parent.right
            anchors.verticalCenter: parent.verticalCenter
            //-- Header
            Item {
                height:             expandedRow.height
                anchors.left:       parent.left
                anchors.right:      parent.right
                Row {
                    id:                         expandedRow
                    spacing:                    ScreenTools.defaultFontPixelWidth
                    anchors.left:               parent.left
                    anchors.leftMargin:         ScreenTools.defaultFontPixelWidth
                    QGCColoredImage {
                        width:                  height
                        height:                 ScreenTools.defaultFontPixelWidth * 2.5
                        sourceSize.height:      height
                        source:                 "qrc:/airmap/advisory-icon.svg"
167
                        color:                  _textColor
Gus Grubba's avatar
Gus Grubba committed
168 169 170 171 172 173 174
                        anchors.verticalCenter: parent.verticalCenter
                    }
                    Column {
                        spacing:                0
                        anchors.verticalCenter: parent.verticalCenter
                        QGCLabel {
                            text:               qsTr("Airspace")
175
                            color:              _textColor
Gus Grubba's avatar
Gus Grubba committed
176 177
                        }
                        QGCLabel {
178
                            text:               _validAdvisories ? QGroundControl.airspaceManager.advisories.advisories.count + qsTr(" Advisories") : ""
179 180
                            color:              _textColor
                            visible:            _validAdvisories
Gus Grubba's avatar
Gus Grubba committed
181 182 183
                            font.pointSize:     ScreenTools.smallFontPointSize
                        }
                    }
Gus Grubba's avatar
Gus Grubba committed
184 185 186 187 188
                    Item {
                        width:  ScreenTools.defaultFontPixelWidth
                        height: 1
                    }
                    AirspaceWeather {
189
                        visible:                QGroundControl.airspaceManager.weatherInfo.valid && showColapse
190
                        contentColor:           _textColor
Gus Grubba's avatar
Gus Grubba committed
191 192
                        anchors.verticalCenter: parent.verticalCenter
                    }
Gus Grubba's avatar
Gus Grubba committed
193
                }
Gus Grubba's avatar
Gus Grubba committed
194 195 196 197 198
                QGCColoredImage {
                    width:                  height
                    height:                 ScreenTools.defaultFontPixelWidth * 2.5
                    sourceSize.height:      height
                    source:                 "qrc:/airmap/colapse.svg"
199
                    color:                  _textColor
Gus Grubba's avatar
Gus Grubba committed
200 201 202 203 204 205
                    visible:                showColapse
                    anchors.right:          parent.right
                    anchors.rightMargin:    ScreenTools.defaultFontPixelWidth
                    anchors.verticalCenter: parent.verticalCenter
                    MouseArea {
                        anchors.fill:   parent
206 207
                        enabled:        showColapse
                        onClicked:      QGroundControl.airspaceManager.airspaceVisible = false
Gus Grubba's avatar
Gus Grubba committed
208 209
                    }
                }
Gus Grubba's avatar
Gus Grubba committed
210
                AirspaceWeather {
211
                    visible:                QGroundControl.airspaceManager.weatherInfo.valid && !showColapse
212
                    contentColor:           _textColor
Gus Grubba's avatar
Gus Grubba committed
213 214 215 216
                    anchors.right:          parent.right
                    anchors.rightMargin:    ScreenTools.defaultFontPixelWidth
                    anchors.verticalCenter: parent.verticalCenter
                }
Gus Grubba's avatar
Gus Grubba committed
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275
            }
            //-- Contents (Brown Box)
            Rectangle {
                color:                      _colorBrown
                height:                     airspaceCol.height + ScreenTools.defaultFontPixelHeight
                radius:                     _radius
                anchors.left:               parent.left
                anchors.leftMargin:         ScreenTools.defaultFontPixelWidth * 0.5
                anchors.right:              parent.right
                anchors.rightMargin:        ScreenTools.defaultFontPixelWidth * 0.5
                Column {
                    id:                     airspaceCol
                    spacing:                ScreenTools.defaultFontPixelHeight * 0.5
                    anchors.left:           parent.left
                    anchors.leftMargin:     ScreenTools.defaultFontPixelWidth  * 0.5
                    anchors.right:          parent.right
                    anchors.rightMargin:    ScreenTools.defaultFontPixelWidth  * 0.5
                    anchors.verticalCenter: parent.verticalCenter
                    //-- Regulations
                    Rectangle {
                        color:                          _colorLightBrown
                        height:                         regCol.height + ScreenTools.defaultFontPixelHeight
                        radius:                         _radius
                        anchors.left:                   parent.left
                        anchors.leftMargin:             ScreenTools.defaultFontPixelWidth * 0.5
                        anchors.right:                  parent.right
                        anchors.rightMargin:            ScreenTools.defaultFontPixelWidth * 0.5
                        Column {
                            id:                         regCol
                            spacing:                    ScreenTools.defaultFontPixelHeight * 0.5
                            anchors.left:               parent.left
                            anchors.leftMargin:         ScreenTools.defaultFontPixelWidth  * 0.5
                            anchors.right:              parent.right
                            anchors.rightMargin:        ScreenTools.defaultFontPixelWidth  * 0.5
                            anchors.verticalCenter:     parent.verticalCenter
                            QGCLabel {
                                text:                   qsTr("Airspace Regulations")
                                color:                  _colorWhite
                                anchors.horizontalCenter: parent.horizontalCenter
                            }
                            QGCLabel {
                                text:                   qsTr("Airspace advisories based on the selected rules.")
                                color:                  _colorWhite
                                anchors.left:           parent.left
                                anchors.right:          parent.right
                                wrapMode:               Text.WordWrap
                                font.pointSize:         ScreenTools.smallFontPointSize
                            }
                            GridLayout {
                                columns:                2
                                anchors.left:           parent.left
                                anchors.right:          parent.right
                                Rectangle {
                                    width:                  regButton.height
                                    height:                 width
                                    radius:                 2
                                    color:                  _colorGray
                                    anchors.verticalCenter: parent.verticalCenter
                                    QGCColoredImage {
Gus Grubba's avatar
Gus Grubba committed
276
                                        id:                 pencilIcon
Gus Grubba's avatar
Gus Grubba committed
277 278 279 280 281 282
                                        width:              height
                                        height:             parent.height * 0.5
                                        sourceSize.height:  height
                                        source:             "qrc:/airmap/pencil.svg"
                                        color:              _colorWhite
                                        anchors.centerIn:   parent
283 284 285 286 287 288 289
                                        MouseArea {
                                            anchors.fill:   parent
                                            onClicked: {
                                                rootLoader.sourceComponent = ruleSelector
                                                mainWindow.disableToolbar()
                                            }
                                        }
Gus Grubba's avatar
Gus Grubba committed
290 291 292 293
                                    }
                                }
                                Rectangle {
                                    id:                     regButton
294
                                    height:                 ScreenTools.defaultFontPixelHeight * 1.5
Gus Grubba's avatar
Gus Grubba committed
295 296 297 298
                                    radius:                 2
                                    color:                  _colorMidBrown
                                    Layout.fillWidth:       true
                                    QGCLabel {
299
                                        id:                     regLabel
300
                                        text:                   _validRules ? QGroundControl.airspaceManager.ruleSets.selectedRuleSets : qsTr("None")
301 302 303 304 305 306 307 308
                                        elide:                  Text.ElideRight
                                        horizontalAlignment:    Text.AlignHCenter
                                        color:                  _colorWhite
                                        anchors.left:           parent.left
                                        anchors.leftMargin:     ScreenTools.defaultFontPixelWidth  * 0.5
                                        anchors.right:          parent.right
                                        anchors.rightMargin:    ScreenTools.defaultFontPixelWidth  * 0.5
                                        anchors.verticalCenter: parent.verticalCenter
Gus Grubba's avatar
Gus Grubba committed
309 310 311 312 313
                                    }
                                }
                            }
                        }
                    }
Gus Grubba's avatar
Gus Grubba committed
314 315 316 317 318 319 320 321 322 323 324 325 326 327 328
                    Flickable {
                        clip:               true
                        height:             ScreenTools.defaultFontPixelHeight * 8
                        contentHeight:      advisoryCol.height
                        flickableDirection: Flickable.VerticalFlick
                        anchors.left:       parent.left
                        anchors.leftMargin: ScreenTools.defaultFontPixelWidth * 0.5
                        anchors.right:      parent.right
                        anchors.rightMargin:ScreenTools.defaultFontPixelWidth * 0.5
                        Column {
                            id:             advisoryCol
                            spacing:        ScreenTools.defaultFontPixelHeight * 0.5
                            anchors.right:  parent.right
                            anchors.left:   parent.left
                            Repeater {
329
                                model:      _validAdvisories ? QGroundControl.airspaceManager.advisories.advisories : []
Gus Grubba's avatar
Gus Grubba committed
330 331 332 333 334 335 336 337 338 339 340
                                delegate: AirspaceRegulation {
                                    regTitle:            object.typeStr
                                    regText:             object.name
                                    regColor:            getAispaceColor(object.color)
                                    anchors.right:       parent.right
                                    anchors.rightMargin: ScreenTools.defaultFontPixelWidth
                                    anchors.left:        parent.left
                                    anchors.leftMargin:  ScreenTools.defaultFontPixelWidth
                                }
                            }
                        }
Gus Grubba's avatar
Gus Grubba committed
341 342 343 344 345 346
                    }
                }
            }
            //-- Footer
            QGCLabel {
                text:           qsTr("Powered by <b>AIRMAP</b>")
347
                color:          _textColor
Gus Grubba's avatar
Gus Grubba committed
348 349 350 351 352
                font.pointSize: ScreenTools.smallFontPointSize
                anchors.horizontalCenter: parent.horizontalCenter
            }
        }
    }
353 354 355 356 357 358 359 360 361 362
    //---------------------------------------------------------------
    //-- Rule Selector
    Component {
        id:             ruleSelector
        Rectangle {
            width:      mainWindow.width
            height:     mainWindow.height
            color:      Qt.rgba(0,0,0,0.1)
            MouseArea {
                anchors.fill:   parent
Gus Grubba's avatar
Gus Grubba committed
363
                onWheel:   { wheel.accepted = true; }
364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387
                onClicked: {
                    mainWindow.enableToolbar()
                    rootLoader.sourceComponent = null
                }
            }
            Rectangle {
                id:             ruleSelectorShadow
                anchors.fill:   ruleSelectorRect
                radius:         ruleSelectorRect.radius
                color:          qgcPal.window
                visible:        false
            }
            DropShadow {
                anchors.fill:       ruleSelectorShadow
                visible:            ruleSelectorRect.visible
                horizontalOffset:   4
                verticalOffset:     4
                radius:             32.0
                samples:            65
                color:              Qt.rgba(0,0,0,0.75)
                source:             ruleSelectorShadow
            }
            Rectangle {
                id:                 ruleSelectorRect
Gus Grubba's avatar
Gus Grubba committed
388 389
                x:                  0
                y:                  0
390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418
                color:              qgcPal.window
                width:              rulesCol.width  + ScreenTools.defaultFontPixelWidth
                height:             rulesCol.height + ScreenTools.defaultFontPixelHeight
                radius:             ScreenTools.defaultFontPixelWidth
                Column {
                    id:             rulesCol
                    spacing:        ScreenTools.defaultFontPixelHeight * 0.5
                    anchors.centerIn: parent
                    //-- Regulations
                    Rectangle {
                        color:      qgcPal.windowShade
                        height:     rulesTitle.height + ScreenTools.defaultFontPixelHeight
                        width:      parent.width * 0.95
                        radius:     _radius
                        anchors.horizontalCenter: parent.horizontalCenter
                        QGCLabel {
                            id:         rulesTitle
                            text:       qsTr("Airspace Regulation Options")
                            anchors.centerIn: parent
                        }
                    }
                    Flickable {
                        clip:           true
                        width:          ScreenTools.defaultFontPixelWidth  * 30
                        height:         ScreenTools.defaultFontPixelHeight * 14
                        contentHeight:  rulesetCol.height
                        flickableDirection: Flickable.VerticalFlick
                        Column {
                            id:         rulesetCol
Gus Grubba's avatar
Gus Grubba committed
419
                            spacing:    ScreenTools.defaultFontPixelHeight * 0.25
420 421
                            anchors.right: parent.right
                            anchors.left:  parent.left
Gus Grubba's avatar
Gus Grubba committed
422 423 424 425 426 427
                            anchors.rightMargin:    ScreenTools.defaultFontPixelWidth * 2
                            anchors.leftMargin:     ScreenTools.defaultFontPixelWidth * 2
                            Item {
                                width:  1
                                height: 1
                            }
428
                            ExclusiveGroup { id: rulesGroup }
429
                            QGCLabel {
Gus Grubba's avatar
Gus Grubba committed
430
                                text:           qsTr("PICK ONE REGULATION")
431
                                font.pointSize: ScreenTools.smallFontPointSize
Gus Grubba's avatar
Gus Grubba committed
432
                                anchors.leftMargin: ScreenTools.defaultFontPixelWidth * 2
433 434
                            }
                            Repeater {
435
                                model:    _validRules ? QGroundControl.airspaceManager.ruleSets.ruleSets : []
Gus Grubba's avatar
Gus Grubba committed
436
                                delegate: RuleSelector {
437
                                    visible:             object.selectionType === AirspaceRuleSet.Pickone
Gus Grubba's avatar
Gus Grubba committed
438
                                    rule:                object
439
                                    exclusiveGroup:      rulesGroup
Gus Grubba's avatar
Gus Grubba committed
440
                                    anchors.right:       parent.right
441
                                    anchors.rightMargin: ScreenTools.defaultFontPixelWidth
Gus Grubba's avatar
Gus Grubba committed
442 443 444 445 446 447 448 449 450 451 452 453 454 455
                                    anchors.left:        parent.left
                                    anchors.leftMargin:  ScreenTools.defaultFontPixelWidth
                                }
                            }
                            Item {
                                width:  1
                                height: 1
                            }
                            QGCLabel {
                                text:           qsTr("OPTIONAL")
                                font.pointSize: ScreenTools.smallFontPointSize
                                anchors.leftMargin: ScreenTools.defaultFontPixelWidth * 2
                            }
                            Repeater {
456
                                model:    _validRules ? QGroundControl.airspaceManager.ruleSets.ruleSets : []
Gus Grubba's avatar
Gus Grubba committed
457
                                delegate: RuleSelector {
458
                                    visible:             object.selectionType === AirspaceRuleSet.Optional
Gus Grubba's avatar
Gus Grubba committed
459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475
                                    rule:                object
                                    anchors.right:       parent.right
                                    anchors.rightMargin: ScreenTools.defaultFontPixelWidth
                                    anchors.left:        parent.left
                                    anchors.leftMargin:  ScreenTools.defaultFontPixelWidth
                                }
                            }
                            Item {
                                width:  1
                                height: 1
                            }
                            QGCLabel {
                                text:           qsTr("REQUIRED")
                                font.pointSize: ScreenTools.smallFontPointSize
                                anchors.leftMargin: ScreenTools.defaultFontPixelWidth * 2
                            }
                            Repeater {
476
                                model:    _validRules ? QGroundControl.airspaceManager.ruleSets.ruleSets : []
Gus Grubba's avatar
Gus Grubba committed
477
                                delegate: RuleSelector {
478
                                    visible:             object.selectionType === AirspaceRuleSet.Required
Gus Grubba's avatar
Gus Grubba committed
479
                                    rule:                object
480
                                    required:            true
Gus Grubba's avatar
Gus Grubba committed
481 482 483
                                    anchors.right:       parent.right
                                    anchors.rightMargin: ScreenTools.defaultFontPixelWidth
                                    anchors.left:        parent.left
484 485 486 487 488 489 490
                                    anchors.leftMargin:  ScreenTools.defaultFontPixelWidth
                                }
                            }
                        }
                    }
                }
            }
Gus Grubba's avatar
Gus Grubba committed
491 492 493 494 495 496 497 498 499 500 501
            //-- Arrow
            QGCColoredImage {
                id:                 arrowIconShadow
                anchors.fill:       arrowIcon
                sourceSize.height:  height
                source:             "qrc:/airmap/right-arrow.svg"
                color:              qgcPal.window
                visible:            false
            }
            DropShadow {
                anchors.fill:       arrowIconShadow
502
                visible:            ruleSelectorRect.visible && qgcPal.globalTheme === QGCPalette.Dark
Gus Grubba's avatar
Gus Grubba committed
503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520
                horizontalOffset:   4
                verticalOffset:     4
                radius:             32.0
                samples:            65
                color:              Qt.rgba(0,0,0,0.75)
                source:             arrowIconShadow
            }
            QGCColoredImage {
                id:                 arrowIcon
                width:              height
                height:             ScreenTools.defaultFontPixelHeight * 2
                sourceSize.height:  height
                source:             "qrc:/airmap/right-arrow.svg"
                color:              ruleSelectorRect.color
                anchors.left:       ruleSelectorRect.right
                anchors.top:        ruleSelectorRect.top
                anchors.topMargin:  (ScreenTools.defaultFontPixelHeight * 4) - (height * 0.5) + (pencilIcon.height * 0.5)
            }
521 522
            Component.onCompleted: {
                mainWindow.disableToolbar()
Gus Grubba's avatar
Gus Grubba committed
523 524 525
                var target = mainWindow.mapFromItem(pencilIcon, 0, 0)
                ruleSelectorRect.x = target.x - ruleSelectorRect.width - (ScreenTools.defaultFontPixelWidth * 7)
                ruleSelectorRect.y = target.y - (ScreenTools.defaultFontPixelHeight * 4)
526 527 528
            }
        }
    }
Gus Grubba's avatar
Gus Grubba committed
529
}