QmlTest.qml 42.8 KB
Newer Older
1 2
import QtQuick 2.3
import QtQuick.Controls 1.2
3
import QtQuick.Controls.Styles 1.4
4
import QtQuick.Layouts          1.2
Don Gagne's avatar
Don Gagne committed
5

6 7 8
import QGroundControl.Palette       1.0
import QGroundControl.Controls      1.0
import QGroundControl.ScreenTools   1.0
Don Gagne's avatar
Don Gagne committed
9 10 11

Rectangle {

12 13 14

    QGCPalette { id: qgcPal; colorGroupEnabled: enabled }

15
    property var palette: QGCPalette { colorGroupEnabled: true }
16
    color: "white"
Don Gagne's avatar
Don Gagne committed
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 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 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
    Component {
        id: arbBox
        Rectangle {
            width:  arbGrid.width  * 1.5
            height: arbGrid.height * 1.5
            color:  backgroundColor
            border.color: qgcPal.text
            border.width: 1
            anchors.horizontalCenter: parent.horizontalCenter
            GridLayout {
                id: arbGrid
                columns: 4
                rowSpacing: 10
                anchors.centerIn: parent
                QGCColoredImage {
                    color:                      qgcPal.colorGreen
                    width:                      ScreenTools.defaultFontPixelWidth * 2
                    height:                     width
                    sourceSize.height:          width
                    mipmap:                     true
                    fillMode:                   Image.PreserveAspectFit
                    source:                     "/qmlimages/Gears.svg"
                }
                Label { text: "colorGreen"; color: qgcPal.colorGreen; }
                QGCColoredImage {
                    color:                      qgcPal.colorOrange
                    width:                      ScreenTools.defaultFontPixelWidth * 2
                    height:                     width
                    sourceSize.height:          width
                    mipmap:                     true
                    fillMode:                   Image.PreserveAspectFit
                    source:                     "/qmlimages/Gears.svg"
                }
                Label { text: "colorOrange"; color: qgcPal.colorOrange; }
                QGCColoredImage {
                    color:                      qgcPal.colorRed
                    width:                      ScreenTools.defaultFontPixelWidth * 2
                    height:                     width
                    sourceSize.height:          width
                    mipmap:                     true
                    fillMode:                   Image.PreserveAspectFit
                    source:                     "/qmlimages/Gears.svg"
                }
                Label { text: "colorRed"; color: qgcPal.colorRed; }
                QGCColoredImage {
                    color:                      qgcPal.colorGrey
                    width:                      ScreenTools.defaultFontPixelWidth * 2
                    height:                     width
                    sourceSize.height:          width
                    mipmap:                     true
                    fillMode:                   Image.PreserveAspectFit
                    source:                     "/qmlimages/Gears.svg"
                }
                Label { text: "colorGrey"; color: qgcPal.colorGrey;  }
                QGCColoredImage {
                    color:                      qgcPal.colorBlue
                    width:                      ScreenTools.defaultFontPixelWidth * 2
                    height:                     width
                    sourceSize.height:          width
                    mipmap:                     true
                    fillMode:                   Image.PreserveAspectFit
                    source:                     "/qmlimages/Gears.svg"
                }
                Label { text: "colorBlue"; color: qgcPal.colorBlue; }
            }
        }
    }

Don Gagne's avatar
Don Gagne committed
86
    Column {
Don Gagne's avatar
Don Gagne committed
87

dogmaphobic's avatar
dogmaphobic committed
88 89 90 91 92
        Rectangle {
            width:  parent.width
            height: themeChoice.height * 2
            color:  palette.window
            QGCLabel {
Tomaz Canabrava's avatar
Tomaz Canabrava committed
93
                text: qsTr("Window Color")
dogmaphobic's avatar
dogmaphobic committed
94 95
                anchors.left:           parent.left
                anchors.leftMargin:     20
Don Gagne's avatar
Don Gagne committed
96
            }
dogmaphobic's avatar
dogmaphobic committed
97 98 99 100 101 102 103
            Row {
                id: themeChoice
                anchors.centerIn: parent
                anchors.margins: 20
                spacing:         20
                ExclusiveGroup { id: themeGroup }
                QGCRadioButton {
Tomaz Canabrava's avatar
Tomaz Canabrava committed
104
                    text: qsTr("Light")
dogmaphobic's avatar
dogmaphobic committed
105 106 107 108 109
                    checked: palette.globalTheme === QGCPalette.Light
                    exclusiveGroup: themeGroup
                    onClicked: { palette.globalTheme = QGCPalette.Light }
                }
                QGCRadioButton {
Tomaz Canabrava's avatar
Tomaz Canabrava committed
110
                    text: qsTr("Dark")
dogmaphobic's avatar
dogmaphobic committed
111 112 113 114
                    checked: palette.globalTheme === QGCPalette.Dark
                    exclusiveGroup: themeGroup
                    onClicked: { palette.globalTheme = QGCPalette.Dark }
                }
Don Gagne's avatar
Don Gagne committed
115
            }
Don Gagne's avatar
Don Gagne committed
116 117 118 119 120 121
        }

        Row {
            spacing: 30

            Grid {
122
                columns: 5
Don Gagne's avatar
Don Gagne committed
123 124 125 126 127 128 129 130 131 132
                spacing: 5

                Component {
                    id: rowHeader

                    Text {
                        width: 180
                        height: 20
                        horizontalAlignment: Text.AlignRight
                        verticalAlignment: Text.AlignVCenter
133
                        color: "black"
Don Gagne's avatar
Don Gagne committed
134 135 136
                        text: parent.text
                    }
                }
Don Gagne's avatar
Don Gagne committed
137

Don Gagne's avatar
Don Gagne committed
138 139 140 141 142
                // Header row
                Loader {
                    sourceComponent: rowHeader
                    property var text: ""
                }
Don Gagne's avatar
Don Gagne committed
143
                Text {
Don Gagne's avatar
Don Gagne committed
144
                    width: 80
Don Gagne's avatar
Don Gagne committed
145
                    height: 20
146
                    color: "black"
Don Gagne's avatar
Don Gagne committed
147
                    horizontalAlignment: Text.AlignHCenter
Tomaz Canabrava's avatar
Tomaz Canabrava committed
148
                    text: qsTr("Disabled")
Don Gagne's avatar
Don Gagne committed
149 150 151 152
                }
                Text {
                    width: 80
                    height: 20
153
                    color: "black"
Don Gagne's avatar
Don Gagne committed
154
                    horizontalAlignment: Text.AlignHCenter
Tomaz Canabrava's avatar
Tomaz Canabrava committed
155
                    text: qsTr("Enabled")
Don Gagne's avatar
Don Gagne committed
156
                }
157 158 159 160 161
                Text {
                    width: 80
                    height: 20
                    color: "black"
                    horizontalAlignment: Text.AlignHCenter
Tomaz Canabrava's avatar
Tomaz Canabrava committed
162
                    text: qsTr("Value")
163 164 165 166 167 168
                }
                Text {
                    width: 80
                    height: 20
                    color: "black"
                    horizontalAlignment: Text.AlignHCenter
Tomaz Canabrava's avatar
Tomaz Canabrava committed
169
                    text: qsTr("Value")
170
                }
Don Gagne's avatar
Don Gagne committed
171

Don Gagne's avatar
Don Gagne committed
172 173 174 175 176
                // window
                Loader {
                    sourceComponent: rowHeader
                    property var text: "window"
                }
177
                ClickableColor {
Don Gagne's avatar
Don Gagne committed
178
                    property var palette: QGCPalette { colorGroupEnabled: false }
179 180
                    color: palette.window
                    onColorSelected: palette.window = color
Don Gagne's avatar
Don Gagne committed
181
                }
182
                ClickableColor {
Don Gagne's avatar
Don Gagne committed
183
                    property var palette: QGCPalette { colorGroupEnabled: true }
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201
                    color: palette.window
                    onColorSelected: palette.window = color
                }
                Text {
                    width: 80
                    height: 20
                    color: "black"
                    horizontalAlignment: Text.AlignHCenter
                    property var palette: QGCPalette { colorGroupEnabled: false }
                    text: palette.window
                }
                Text {
                    width: 80
                    height: 20
                    color: "black"
                    horizontalAlignment: Text.AlignHCenter
                    property var palette: QGCPalette { colorGroupEnabled: true }
                    text: palette.window
Don Gagne's avatar
Don Gagne committed
202
                }
Don Gagne's avatar
Don Gagne committed
203

Don Gagne's avatar
Don Gagne committed
204 205 206 207 208
                // windowShade
                Loader {
                    sourceComponent: rowHeader
                    property var text: "windowShade"
                }
209
                ClickableColor {
Don Gagne's avatar
Don Gagne committed
210
                    property var palette: QGCPalette { colorGroupEnabled: false }
211 212
                    color: palette.windowShade
                    onColorSelected: palette.windowShade = color
Don Gagne's avatar
Don Gagne committed
213
                }
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231
                ClickableColor {
                    property var palette: QGCPalette { colorGroupEnabled: true }
                    color: palette.windowShade
                    onColorSelected: palette.windowShade = color
                }
                Text {
                    width: 80
                    height: 20
                    color: "black"
                    horizontalAlignment: Text.AlignHCenter
                    property var palette: QGCPalette { colorGroupEnabled: false }
                    text: palette.windowShade
                }
                Text {
                    width: 80
                    height: 20
                    color: "black"
                    horizontalAlignment: Text.AlignHCenter
Don Gagne's avatar
Don Gagne committed
232
                    property var palette: QGCPalette { colorGroupEnabled: true }
233
                    text: palette.windowShade
Don Gagne's avatar
Don Gagne committed
234
                }
Don Gagne's avatar
Don Gagne committed
235

Don Gagne's avatar
Don Gagne committed
236 237 238 239 240
                // windowShadeDark
                Loader {
                    sourceComponent: rowHeader
                    property var text: "windowShadeDark"
                }
241
                ClickableColor {
Don Gagne's avatar
Don Gagne committed
242
                    property var palette: QGCPalette { colorGroupEnabled: false }
243 244
                    color: palette.windowShadeDark
                    onColorSelected: palette.windowShadeDark = color
Don Gagne's avatar
Don Gagne committed
245
                }
246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263
                ClickableColor {
                    property var palette: QGCPalette { colorGroupEnabled: true }
                    color: palette.windowShadeDark
                    onColorSelected: palette.windowShadeDark = color
                }
                Text {
                    width: 80
                    height: 20
                    color: "black"
                    horizontalAlignment: Text.AlignHCenter
                    property var palette: QGCPalette { colorGroupEnabled: false }
                    text: palette.windowShadeDark
                }
                Text {
                    width: 80
                    height: 20
                    color: "black"
                    horizontalAlignment: Text.AlignHCenter
Don Gagne's avatar
Don Gagne committed
264
                    property var palette: QGCPalette { colorGroupEnabled: true }
265
                    text: palette.windowShadeDark
Don Gagne's avatar
Don Gagne committed
266
                }
Don Gagne's avatar
Don Gagne committed
267

Don Gagne's avatar
Don Gagne committed
268 269 270 271 272
                // text
                Loader {
                    sourceComponent: rowHeader
                    property var text: "text"
                }
273
                ClickableColor {
Don Gagne's avatar
Don Gagne committed
274
                    property var palette: QGCPalette { colorGroupEnabled: false }
275 276
                    color: palette.text
                    onColorSelected: palette.text = color
Don Gagne's avatar
Don Gagne committed
277
                }
278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295
                ClickableColor {
                    property var palette: QGCPalette { colorGroupEnabled: true }
                    color: palette.text
                    onColorSelected: palette.text = color
                }
                Text {
                    width: 80
                    height: 20
                    color: "black"
                    horizontalAlignment: Text.AlignHCenter
                    property var palette: QGCPalette { colorGroupEnabled: false }
                    text: palette.text
                }
                Text {
                    width: 80
                    height: 20
                    color: "black"
                    horizontalAlignment: Text.AlignHCenter
Don Gagne's avatar
Don Gagne committed
296
                    property var palette: QGCPalette { colorGroupEnabled: true }
297
                    text: palette.text
Don Gagne's avatar
Don Gagne committed
298
                }
Don Gagne's avatar
Don Gagne committed
299

Don Gagne's avatar
Don Gagne committed
300 301 302 303 304
                // button
                Loader {
                    sourceComponent: rowHeader
                    property var text: "button"
                }
305
                ClickableColor {
Don Gagne's avatar
Don Gagne committed
306
                    property var palette: QGCPalette { colorGroupEnabled: false }
307 308
                    color: palette.button
                    onColorSelected: palette.button = color
Don Gagne's avatar
Don Gagne committed
309
                }
310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327
                ClickableColor {
                    property var palette: QGCPalette { colorGroupEnabled: true }
                    color: palette.button
                    onColorSelected: palette.button = color
                }
                Text {
                    width: 80
                    height: 20
                    color: "black"
                    horizontalAlignment: Text.AlignHCenter
                    property var palette: QGCPalette { colorGroupEnabled: false }
                    text: palette.button
                }
                Text {
                    width: 80
                    height: 20
                    color: "black"
                    horizontalAlignment: Text.AlignHCenter
Don Gagne's avatar
Don Gagne committed
328
                    property var palette: QGCPalette { colorGroupEnabled: true }
329
                    text: palette.button
Don Gagne's avatar
Don Gagne committed
330
                }
Don Gagne's avatar
Don Gagne committed
331

Don Gagne's avatar
Don Gagne committed
332 333 334 335 336
                // buttonText
                Loader {
                    sourceComponent: rowHeader
                    property var text: "buttonText"
                }
337
                ClickableColor {
Don Gagne's avatar
Don Gagne committed
338
                    property var palette: QGCPalette { colorGroupEnabled: false }
339 340
                    color: palette.buttonText
                    onColorSelected: palette.buttonText = color
Don Gagne's avatar
Don Gagne committed
341
                }
342
                ClickableColor {
Don Gagne's avatar
Don Gagne committed
343
                    property var palette: QGCPalette { colorGroupEnabled: true }
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361
                    color: palette.buttonText
                    onColorSelected: palette.buttonText = color
                }
                Text {
                    width: 80
                    height: 20
                    color: "black"
                    horizontalAlignment: Text.AlignHCenter
                    property var palette: QGCPalette { colorGroupEnabled: false }
                    text: palette.buttonText
                }
                Text {
                    width: 80
                    height: 20
                    color: "black"
                    horizontalAlignment: Text.AlignHCenter
                    property var palette: QGCPalette { colorGroupEnabled: true }
                    text: palette.buttonText
Don Gagne's avatar
Don Gagne committed
362
                }
363

Don Gagne's avatar
Don Gagne committed
364 365 366 367 368
                // buttonHighlight
                Loader {
                    sourceComponent: rowHeader
                    property var text: "buttonHighlight"
                }
369
                ClickableColor {
Don Gagne's avatar
Don Gagne committed
370
                    property var palette: QGCPalette { colorGroupEnabled: false }
371 372
                    color: palette.buttonHighlight
                    onColorSelected: palette.buttonHighlight = color
Don Gagne's avatar
Don Gagne committed
373
                }
374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391
                ClickableColor {
                    property var palette: QGCPalette { colorGroupEnabled: true }
                    color: palette.buttonHighlight
                    onColorSelected: palette.buttonHighlight = color
                }
                Text {
                    width: 80
                    height: 20
                    color: "black"
                    horizontalAlignment: Text.AlignHCenter
                    property var palette: QGCPalette { colorGroupEnabled: false }
                    text: palette.buttonHighlight
                }
                Text {
                    width: 80
                    height: 20
                    color: "black"
                    horizontalAlignment: Text.AlignHCenter
Don Gagne's avatar
Don Gagne committed
392
                    property var palette: QGCPalette { colorGroupEnabled: true }
393
                    text: palette.buttonHighlight
Don Gagne's avatar
Don Gagne committed
394
                }
Don Gagne's avatar
Don Gagne committed
395

Don Gagne's avatar
Don Gagne committed
396 397 398 399 400
                // buttonHighlightText
                Loader {
                    sourceComponent: rowHeader
                    property var text: "buttonHighlightText"
                }
401
                ClickableColor {
Don Gagne's avatar
Don Gagne committed
402
                    property var palette: QGCPalette { colorGroupEnabled: false }
403 404
                    color: palette.buttonHighlightText
                    onColorSelected: palette.buttonHighlightText = color
Don Gagne's avatar
Don Gagne committed
405
                }
406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423
                ClickableColor {
                    property var palette: QGCPalette { colorGroupEnabled: true }
                    color: palette.buttonHighlightText
                    onColorSelected: palette.buttonHighlightText = color
                }
                Text {
                    width: 80
                    height: 20
                    color: "black"
                    horizontalAlignment: Text.AlignHCenter
                    property var palette: QGCPalette { colorGroupEnabled: false }
                    text: palette.buttonHighlightText
                }
                Text {
                    width: 80
                    height: 20
                    color: "black"
                    horizontalAlignment: Text.AlignHCenter
Don Gagne's avatar
Don Gagne committed
424
                    property var palette: QGCPalette { colorGroupEnabled: true }
425
                    text: palette.buttonHighlightText
Don Gagne's avatar
Don Gagne committed
426
                }
Don Gagne's avatar
Don Gagne committed
427

Don Gagne's avatar
Don Gagne committed
428 429 430 431 432
                // primaryButton
                Loader {
                    sourceComponent: rowHeader
                    property var text: "primaryButton"
                }
433
                ClickableColor {
Don Gagne's avatar
Don Gagne committed
434
                    property var palette: QGCPalette { colorGroupEnabled: false }
435 436
                    color: palette.primaryButton
                    onColorSelected: palette.primaryButton = color
Don Gagne's avatar
Don Gagne committed
437
                }
438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455
                ClickableColor {
                    property var palette: QGCPalette { colorGroupEnabled: true }
                    color: palette.primaryButton
                    onColorSelected: palette.primaryButton = color
                }
                Text {
                    width: 80
                    height: 20
                    color: "black"
                    horizontalAlignment: Text.AlignHCenter
                    property var palette: QGCPalette { colorGroupEnabled: false }
                    text: palette.primaryButton
                }
                Text {
                    width: 80
                    height: 20
                    color: "black"
                    horizontalAlignment: Text.AlignHCenter
Don Gagne's avatar
Don Gagne committed
456
                    property var palette: QGCPalette { colorGroupEnabled: true }
457
                    text: palette.primaryButton
Don Gagne's avatar
Don Gagne committed
458
                }
Don Gagne's avatar
Don Gagne committed
459

Don Gagne's avatar
Don Gagne committed
460 461 462 463 464
                // primaryButtonText
                Loader {
                    sourceComponent: rowHeader
                    property var text: "primaryButtonText"
                }
465
                ClickableColor {
Don Gagne's avatar
Don Gagne committed
466
                    property var palette: QGCPalette { colorGroupEnabled: false }
467 468
                    color: palette.primaryButtonText
                    onColorSelected: palette.primaryButtonText = color
Don Gagne's avatar
Don Gagne committed
469
                }
470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487
                ClickableColor {
                    property var palette: QGCPalette { colorGroupEnabled: true }
                    color: palette.primaryButtonText
                    onColorSelected: palette.primaryButtonText = color
                }
                Text {
                    width: 80
                    height: 20
                    color: "black"
                    horizontalAlignment: Text.AlignHCenter
                    property var palette: QGCPalette { colorGroupEnabled: false }
                    text: palette.primaryButtonText
                }
                Text {
                    width: 80
                    height: 20
                    color: "black"
                    horizontalAlignment: Text.AlignHCenter
Don Gagne's avatar
Don Gagne committed
488
                    property var palette: QGCPalette { colorGroupEnabled: true }
489
                    text: palette.primaryButtonText
Don Gagne's avatar
Don Gagne committed
490
                }
Don Gagne's avatar
Don Gagne committed
491

Don Gagne's avatar
Don Gagne committed
492 493 494 495 496
                // textField
                Loader {
                    sourceComponent: rowHeader
                    property var text: "textField"
                }
497
                ClickableColor {
Don Gagne's avatar
Don Gagne committed
498
                    property var palette: QGCPalette { colorGroupEnabled: false }
499 500
                    color: palette.textField
                    onColorSelected: palette.textField = color
Don Gagne's avatar
Don Gagne committed
501
                }
502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519
                ClickableColor {
                    property var palette: QGCPalette { colorGroupEnabled: true }
                    color: palette.textField
                    onColorSelected: palette.textField = color
                }
                Text {
                    width: 80
                    height: 20
                    color: "black"
                    horizontalAlignment: Text.AlignHCenter
                    property var palette: QGCPalette { colorGroupEnabled: false }
                    text: palette.textField
                }
                Text {
                    width: 80
                    height: 20
                    color: "black"
                    horizontalAlignment: Text.AlignHCenter
Don Gagne's avatar
Don Gagne committed
520
                    property var palette: QGCPalette { colorGroupEnabled: true }
521
                    text: palette.textField
Don Gagne's avatar
Don Gagne committed
522
                }
523

Don Gagne's avatar
Don Gagne committed
524 525 526 527 528
                // textFieldText
                Loader {
                    sourceComponent: rowHeader
                    property var text: "textFieldText"
                }
529
                ClickableColor {
Don Gagne's avatar
Don Gagne committed
530
                    property var palette: QGCPalette { colorGroupEnabled: false }
531 532
                    color: palette.textFieldText
                    onColorSelected: palette.textFieldText = color
Don Gagne's avatar
Don Gagne committed
533
                }
534
                ClickableColor {
Don Gagne's avatar
Don Gagne committed
535
                    property var palette: QGCPalette { colorGroupEnabled: true }
536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553
                    color: palette.textFieldText
                    onColorSelected: palette.textFieldText = color
                }
                Text {
                    width: 80
                    height: 20
                    color: "black"
                    horizontalAlignment: Text.AlignHCenter
                    property var palette: QGCPalette { colorGroupEnabled: false }
                    text: palette.textFieldText
                }
                Text {
                    width: 80
                    height: 20
                    color: "black"
                    horizontalAlignment: Text.AlignHCenter
                    property var palette: QGCPalette { colorGroupEnabled: true }
                    text: palette.textFieldText
Don Gagne's avatar
Don Gagne committed
554
                }
dogmaphobic's avatar
dogmaphobic committed
555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586

                // warningText
                Loader {
                    sourceComponent: rowHeader
                    property var text: "warningText"
                }
                ClickableColor {
                    property var palette: QGCPalette { colorGroupEnabled: false }
                    color: palette.warningText
                    onColorSelected: palette.warningText = color
                }
                ClickableColor {
                    property var palette: QGCPalette { colorGroupEnabled: true }
                    color: palette.warningText
                    onColorSelected: palette.warningText = color
                }
                Text {
                    width: 80
                    height: 20
                    color: "black"
                    horizontalAlignment: Text.AlignHCenter
                    property var palette: QGCPalette { colorGroupEnabled: false }
                    text: palette.warningText
                }
                Text {
                    width: 80
                    height: 20
                    color: "black"
                    horizontalAlignment: Text.AlignHCenter
                    property var palette: QGCPalette { colorGroupEnabled: true }
                    text: palette.warningText
                }
587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747

                // colorGreen
                Loader {
                    sourceComponent: rowHeader
                    property var text: "colorGreen"
                }
                ClickableColor {
                    property var palette: QGCPalette { colorGroupEnabled: false }
                    color: palette.colorGreen
                    onColorSelected: palette.colorGreen = color
                }
                ClickableColor {
                    property var palette: QGCPalette { colorGroupEnabled: true }
                    color: palette.colorGreen
                    onColorSelected: palette.colorGreen = color
                }
                Text {
                    width: 80
                    height: 20
                    color: "black"
                    horizontalAlignment: Text.AlignHCenter
                    property var palette: QGCPalette { colorGroupEnabled: false }
                    text: palette.colorGreen
                }
                Text {
                    width: 80
                    height: 20
                    color: "black"
                    horizontalAlignment: Text.AlignHCenter
                    property var palette: QGCPalette { colorGroupEnabled: true }
                    text: palette.colorGreen
                }

                // colorOrange
                Loader {
                    sourceComponent: rowHeader
                    property var text: "colorOrange"
                }
                ClickableColor {
                    property var palette: QGCPalette { colorGroupEnabled: false }
                    color: palette.colorOrange
                    onColorSelected: palette.colorOrange = color
                }
                ClickableColor {
                    property var palette: QGCPalette { colorGroupEnabled: true }
                    color: palette.colorOrange
                    onColorSelected: palette.colorOrange = color
                }
                Text {
                    width: 80
                    height: 20
                    color: "black"
                    horizontalAlignment: Text.AlignHCenter
                    property var palette: QGCPalette { colorGroupEnabled: false }
                    text: palette.colorOrange
                }
                Text {
                    width: 80
                    height: 20
                    color: "black"
                    horizontalAlignment: Text.AlignHCenter
                    property var palette: QGCPalette { colorGroupEnabled: true }
                    text: palette.colorOrange
                }

                // colorRed
                Loader {
                    sourceComponent: rowHeader
                    property var text: "colorRed"
                }
                ClickableColor {
                    property var palette: QGCPalette { colorGroupEnabled: false }
                    color: palette.colorRed
                    onColorSelected: palette.colorRed = color
                }
                ClickableColor {
                    property var palette: QGCPalette { colorGroupEnabled: true }
                    color: palette.colorRed
                    onColorSelected: palette.colorRed = color
                }
                Text {
                    width: 80
                    height: 20
                    color: "black"
                    horizontalAlignment: Text.AlignHCenter
                    property var palette: QGCPalette { colorGroupEnabled: false }
                    text: palette.colorRed
                }
                Text {
                    width: 80
                    height: 20
                    color: "black"
                    horizontalAlignment: Text.AlignHCenter
                    property var palette: QGCPalette { colorGroupEnabled: true }
                    text: palette.colorRed
                }

                // colorGrey
                Loader {
                    sourceComponent: rowHeader
                    property var text: "colorGrey"
                }
                ClickableColor {
                    property var palette: QGCPalette { colorGroupEnabled: false }
                    color: palette.colorGrey
                    onColorSelected: palette.colorGrey = color
                }
                ClickableColor {
                    property var palette: QGCPalette { colorGroupEnabled: true }
                    color: palette.colorGrey
                    onColorSelected: palette.colorGrey = color
                }
                Text {
                    width: 80
                    height: 20
                    color: "black"
                    horizontalAlignment: Text.AlignHCenter
                    property var palette: QGCPalette { colorGroupEnabled: false }
                    text: palette.colorGrey
                }
                Text {
                    width: 80
                    height: 20
                    color: "black"
                    horizontalAlignment: Text.AlignHCenter
                    property var palette: QGCPalette { colorGroupEnabled: true }
                    text: palette.colorGrey
                }

                // colorBlue
                Loader {
                    sourceComponent: rowHeader
                    property var text: "colorBlue"
                }
                ClickableColor {
                    property var palette: QGCPalette { colorGroupEnabled: false }
                    color: palette.colorBlue
                    onColorSelected: palette.colorBlue = color
                }
                ClickableColor {
                    property var palette: QGCPalette { colorGroupEnabled: true }
                    color: palette.colorBlue
                    onColorSelected: palette.colorBlue = color
                }
                Text {
                    width: 80
                    height: 20
                    color: "black"
                    horizontalAlignment: Text.AlignHCenter
                    property var palette: QGCPalette { colorGroupEnabled: false }
                    text: palette.colorBlue
                }
                Text {
                    width: 80
                    height: 20
                    color: "black"
                    horizontalAlignment: Text.AlignHCenter
                    property var palette: QGCPalette { colorGroupEnabled: true }
                    text: palette.colorBlue
                }

Gus Grubba's avatar
Gus Grubba committed
748
                // alertBackground
Don Gagne's avatar
Don Gagne committed
749
                Loader {
Gus Grubba's avatar
Gus Grubba committed
750 751 752 753 754 755 756 757 758 759 760 761
                    sourceComponent: rowHeader
                    property var text: "alertBackground"
                }
                ClickableColor {
                    property var palette: QGCPalette { colorGroupEnabled: false }
                    color: palette.alertBackground
                    onColorSelected: palette.alertBackground = color
                }
                ClickableColor {
                    property var palette: QGCPalette { colorGroupEnabled: true }
                    color: palette.alertBackground
                    onColorSelected: palette.alertBackground = color
Don Gagne's avatar
Don Gagne committed
762
                }
Don Gagne's avatar
Don Gagne committed
763
                Text {
Gus Grubba's avatar
Gus Grubba committed
764
                    width: 80
Don Gagne's avatar
Don Gagne committed
765
                    height: 20
766
                    color: "black"
Don Gagne's avatar
Don Gagne committed
767
                    horizontalAlignment: Text.AlignHCenter
Gus Grubba's avatar
Gus Grubba committed
768 769
                    property var palette: QGCPalette { colorGroupEnabled: false }
                    text: palette.alertBackground
Don Gagne's avatar
Don Gagne committed
770 771
                }
                Text {
Gus Grubba's avatar
Gus Grubba committed
772
                    width: 80
Don Gagne's avatar
Don Gagne committed
773
                    height: 20
774
                    color: "black"
Don Gagne's avatar
Don Gagne committed
775
                    horizontalAlignment: Text.AlignHCenter
Gus Grubba's avatar
Gus Grubba committed
776 777
                    property var palette: QGCPalette { colorGroupEnabled: true }
                    text: palette.alertBackground
Don Gagne's avatar
Don Gagne committed
778 779
                }

Gus Grubba's avatar
Gus Grubba committed
780
                // alertBorder
Don Gagne's avatar
Don Gagne committed
781
                Loader {
Gus Grubba's avatar
Gus Grubba committed
782 783
                    sourceComponent: rowHeader
                    property var text: "alertBorder"
Don Gagne's avatar
Don Gagne committed
784
                }
Gus Grubba's avatar
Gus Grubba committed
785 786 787 788
                ClickableColor {
                    property var palette: QGCPalette { colorGroupEnabled: false }
                    color: palette.alertBorder
                    onColorSelected: palette.alertBorder = color
Don Gagne's avatar
Don Gagne committed
789
                }
Gus Grubba's avatar
Gus Grubba committed
790 791 792 793
                ClickableColor {
                    property var palette: QGCPalette { colorGroupEnabled: true }
                    color: palette.alertBorder
                    onColorSelected: palette.alertBorder = color
Don Gagne's avatar
Don Gagne committed
794
                }
Gus Grubba's avatar
Gus Grubba committed
795 796
                Text {
                    width: 80
Don Gagne's avatar
Don Gagne committed
797
                    height: 20
Gus Grubba's avatar
Gus Grubba committed
798 799 800 801
                    color: "black"
                    horizontalAlignment: Text.AlignHCenter
                    property var palette: QGCPalette { colorGroupEnabled: false }
                    text: palette.alertBorder
Don Gagne's avatar
Don Gagne committed
802
                }
Gus Grubba's avatar
Gus Grubba committed
803 804
                Text {
                    width: 80
Don Gagne's avatar
Don Gagne committed
805
                    height: 20
Gus Grubba's avatar
Gus Grubba committed
806 807 808 809
                    color: "black"
                    horizontalAlignment: Text.AlignHCenter
                    property var palette: QGCPalette { colorGroupEnabled: true }
                    text: palette.alertBorder
Don Gagne's avatar
Don Gagne committed
810
                }
Don Gagne's avatar
Don Gagne committed
811

Gus Grubba's avatar
Gus Grubba committed
812
                // alertText
Don Gagne's avatar
Don Gagne committed
813
                Loader {
Gus Grubba's avatar
Gus Grubba committed
814 815
                    sourceComponent: rowHeader
                    property var text: "alertText"
Don Gagne's avatar
Don Gagne committed
816
                }
Gus Grubba's avatar
Gus Grubba committed
817 818 819 820 821 822 823 824 825 826 827 828
                ClickableColor {
                    property var palette: QGCPalette { colorGroupEnabled: false }
                    color: palette.alertText
                    onColorSelected: palette.alertText = color
                }
                ClickableColor {
                    property var palette: QGCPalette { colorGroupEnabled: true }
                    color: palette.alertText
                    onColorSelected: palette.alertText = color
                }
                Text {
                    width: 80
Don Gagne's avatar
Don Gagne committed
829
                    height: 20
Gus Grubba's avatar
Gus Grubba committed
830 831 832 833
                    color: "black"
                    horizontalAlignment: Text.AlignHCenter
                    property var palette: QGCPalette { colorGroupEnabled: false }
                    text: palette.alertText
Don Gagne's avatar
Don Gagne committed
834
                }
Gus Grubba's avatar
Gus Grubba committed
835 836
                Text {
                    width: 80
Don Gagne's avatar
Don Gagne committed
837
                    height: 20
Gus Grubba's avatar
Gus Grubba committed
838 839 840 841
                    color: "black"
                    horizontalAlignment: Text.AlignHCenter
                    property var palette: QGCPalette { colorGroupEnabled: true }
                    text: palette.alertText
Don Gagne's avatar
Don Gagne committed
842
                }
843

Gus Grubba's avatar
Gus Grubba committed
844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875
                // missionItemEditor
                Loader {
                    sourceComponent: rowHeader
                    property var text: "missionItemEditor"
                }
                ClickableColor {
                    property var palette: QGCPalette { colorGroupEnabled: false }
                    color: palette.missionItemEditor
                    onColorSelected: palette.missionItemEditor = color
                }
                ClickableColor {
                    property var palette: QGCPalette { colorGroupEnabled: true }
                    color: palette.missionItemEditor
                    onColorSelected: palette.missionItemEditor = color
                }
                Text {
                    width: 80
                    height: 20
                    color: "black"
                    horizontalAlignment: Text.AlignHCenter
                    property var palette: QGCPalette { colorGroupEnabled: false }
                    text: palette.missionItemEditor
                }
                Text {
                    width: 80
                    height: 20
                    color: "black"
                    horizontalAlignment: Text.AlignHCenter
                    property var palette: QGCPalette { colorGroupEnabled: true }
                    text: palette.missionItemEditor
                }

Gus Grubba's avatar
Gus Grubba committed
876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896
            }

            Column {
                spacing: 10
                width: leftGrid.width
                Grid {
                    id: leftGrid
                    columns: 3
                    spacing: 10

                    Component {
                        id: ctlRowHeader

                        Text {
                            width: 120
                            height: 20
                            horizontalAlignment: Text.AlignRight
                            verticalAlignment: Text.AlignVCenter
                            color: "black"
                            text: parent.text
                        }
897
                    }
Gus Grubba's avatar
Gus Grubba committed
898 899 900 901 902 903


                    // Header row
                    Loader {
                        sourceComponent: ctlRowHeader
                        property var text: ""
904
                    }
Gus Grubba's avatar
Gus Grubba committed
905 906 907 908 909 910 911 912 913 914 915 916 917
                    Text {
                        width: 100
                        height: 20
                        color: "black"
                        horizontalAlignment: Text.AlignHCenter
                        text: qsTr("Enabled")
                    }
                    Text {
                        width: 100
                        height: 20
                        color: "black"
                        horizontalAlignment: Text.AlignHCenter
                        text: qsTr("Disabled")
918 919
                    }

Gus Grubba's avatar
Gus Grubba committed
920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935
                    // QGCLabel
                    Loader {
                        sourceComponent: ctlRowHeader
                        property var text: "QGCLabel"
                    }
                    QGCLabel {
                        width: 100
                        height: 20
                        text: qsTr("Label")
                    }
                    QGCLabel {
                        width: 100
                        height: 20
                        text: qsTr("Label")
                        enabled: false
                    }
Don Gagne's avatar
Don Gagne committed
936

Gus Grubba's avatar
Gus Grubba committed
937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952
                    // QGCButton
                    Loader {
                        sourceComponent: ctlRowHeader
                        property var text: "QGCButton"
                    }
                    QGCButton {
                        width: 100
                        height: 20
                        text: qsTr("Button")
                    }
                    QGCButton {
                        width: 100
                        height: 20
                        text: qsTr("Button")
                        enabled: false
                    }
Don Gagne's avatar
Don Gagne committed
953

Gus Grubba's avatar
Gus Grubba committed
954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971
                    // QGCButton - primary
                    Loader {
                        sourceComponent: ctlRowHeader
                        property var text: "QGCButton(primary)"
                    }
                    QGCButton {
                        width: 100
                        height: 20
                        primary: true
                        text: qsTr("Button")
                    }
                    QGCButton {
                        width: 100
                        height: 20
                        text: qsTr("Button")
                        primary: true
                        enabled: false
                    }
972

Gus Grubba's avatar
Gus Grubba committed
973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002
                    // QGCButton - menu
                    Loader {
                        sourceComponent: ctlRowHeader
                        property var text: "QGCButton(menu)"
                    }
                    Menu {
                        id: buttonMenu
                        MenuItem {
                            text: qsTr("Item 1")
                        }
                        MenuItem {
                            text: qsTr("Item 2")
                        }
                        MenuItem {
                            text: qsTr("Item 3")
                        }
                    }
                    QGCButton {
                        width: 100
                        height: 20
                        text: qsTr("Button")
                        menu: buttonMenu
                    }
                    QGCButton {
                        width: 100
                        height: 20
                        text: qsTr("Button")
                        enabled: false
                        menu: buttonMenu
                    }
1003

Gus Grubba's avatar
Gus Grubba committed
1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100
                    // QGCRadioButton
                    Loader {
                        sourceComponent: ctlRowHeader
                        property var text: "QGCRadioButton"
                    }
                    QGCRadioButton {
                        width: 100
                        height: 20
                        text: qsTr("Radio")
                    }
                    QGCRadioButton {
                        width: 100
                        height: 20
                        text: qsTr("Radio")
                        enabled: false
                    }

                    // QGCCheckBox
                    Loader {
                        sourceComponent: ctlRowHeader
                        property var text: "QGCCheckBox"
                    }
                    QGCCheckBox {
                        width: 100
                        height: 20
                        text: qsTr("Check Box")
                    }
                    QGCCheckBox {
                        width: 100
                        height: 20
                        text: qsTr("Check Box")
                        enabled: false
                    }

                    // QGCTextField
                    Loader {
                        sourceComponent: ctlRowHeader
                        property var text: "QGCTextField"
                    }
                    QGCTextField {
                        width: 100
                        height: 20
                        text: "QGCTextField"
                    }
                    QGCTextField {
                        width: 100
                        height: 20
                        text: "QGCTextField"
                        enabled: false
                    }

                    // QGCComboBox
                    Loader {
                        sourceComponent: ctlRowHeader
                        property var text: "QGCComboBox"
                    }
                    QGCComboBox {
                        width: 100
                        height: 20
                        model: [ qsTr("Item 1"), qsTr("Item 2"), qsTr("Item 3") ]
                    }
                    QGCComboBox {
                        width: 100
                        height: 20
                        model: [ qsTr("Item 1"), qsTr("Item 2"), qsTr("Item 3") ]
                        enabled: false
                    }

                    // SubMenuButton
                    Loader {
                        sourceComponent: ctlRowHeader
                        property var text: "SubMenuButton"
                    }
                    SubMenuButton {
                        width: 100
                        height: 100
                        text: qsTr("SUB MENU")
                    }
                    SubMenuButton {
                        width: 100
                        height: 100
                        text: qsTr("SUB MENU")
                        enabled: false
                    }
                }
                Rectangle {
                    width:  leftGrid.width
                    height: 60
                    radius: 3
                    color:  palette.alertBackground
                    border.color: palette.alertBorder
                    anchors.horizontalCenter: parent.horizontalCenter
                    Label {
                        text: "Alert Message"
                        color:  palette.alertText
                        anchors.centerIn: parent
                    }
Don Gagne's avatar
Don Gagne committed
1101
                }
1102
            }
Don Gagne's avatar
Don Gagne committed
1103
        }
1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126

        Item{
            height: 10;
            width:  1;
        }

        Row {
            spacing: 10
            anchors.horizontalCenter: parent.horizontalCenter
            Loader {
                property var backgroundColor: qgcPal.window
                sourceComponent: arbBox
            }
            Loader {
                property var backgroundColor: qgcPal.windowShade
                sourceComponent: arbBox
            }
            Loader {
                property var backgroundColor: qgcPal.windowShadeDark
                sourceComponent: arbBox
            }
        }

Don Gagne's avatar
Don Gagne committed
1127 1128
    }
}