QmlTest.qml 36.3 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
                }

Don Gagne's avatar
Don Gagne committed
748
            }
749

Don Gagne's avatar
Don Gagne committed
750 751 752
            Grid {
                columns: 3
                spacing: 10
Don Gagne's avatar
Don Gagne committed
753

Don Gagne's avatar
Don Gagne committed
754 755
                Component {
                    id: ctlRowHeader
Don Gagne's avatar
Don Gagne committed
756

Don Gagne's avatar
Don Gagne committed
757 758 759 760 761
                    Text {
                        width: 120
                        height: 20
                        horizontalAlignment: Text.AlignRight
                        verticalAlignment: Text.AlignVCenter
762
                        color: "black"
Don Gagne's avatar
Don Gagne committed
763 764 765
                        text: parent.text
                    }
                }
Don Gagne's avatar
Don Gagne committed
766 767


Don Gagne's avatar
Don Gagne committed
768 769 770 771 772
                // Header row
                Loader {
                    sourceComponent: ctlRowHeader
                    property var text: ""
                }
Don Gagne's avatar
Don Gagne committed
773
                Text {
Don Gagne's avatar
Don Gagne committed
774
                    width: 100
Don Gagne's avatar
Don Gagne committed
775
                    height: 20
776
                    color: "black"
Don Gagne's avatar
Don Gagne committed
777
                    horizontalAlignment: Text.AlignHCenter
Tomaz Canabrava's avatar
Tomaz Canabrava committed
778
                    text: qsTr("Enabled")
Don Gagne's avatar
Don Gagne committed
779 780 781 782
                }
                Text {
                    width: 100
                    height: 20
783
                    color: "black"
Don Gagne's avatar
Don Gagne committed
784
                    horizontalAlignment: Text.AlignHCenter
Tomaz Canabrava's avatar
Tomaz Canabrava committed
785
                    text: qsTr("Disabled")
Don Gagne's avatar
Don Gagne committed
786 787
                }

Don Gagne's avatar
Don Gagne committed
788 789 790 791 792 793 794 795
                // QGCLabel
                Loader {
                    sourceComponent: ctlRowHeader
                    property var text: "QGCLabel"
                }
                QGCLabel {
                    width: 100
                    height: 20
Tomaz Canabrava's avatar
Tomaz Canabrava committed
796
                    text: qsTr("Label")
Don Gagne's avatar
Don Gagne committed
797 798 799 800
                }
                QGCLabel {
                    width: 100
                    height: 20
Tomaz Canabrava's avatar
Tomaz Canabrava committed
801
                    text: qsTr("Label")
Don Gagne's avatar
Don Gagne committed
802 803
                    enabled: false
                }
Don Gagne's avatar
Don Gagne committed
804

Don Gagne's avatar
Don Gagne committed
805 806 807 808 809 810 811 812
                // QGCButton
                Loader {
                    sourceComponent: ctlRowHeader
                    property var text: "QGCButton"
                }
                QGCButton {
                    width: 100
                    height: 20
Tomaz Canabrava's avatar
Tomaz Canabrava committed
813
                    text: qsTr("Button")
Don Gagne's avatar
Don Gagne committed
814 815 816 817
                }
                QGCButton {
                    width: 100
                    height: 20
Tomaz Canabrava's avatar
Tomaz Canabrava committed
818
                    text: qsTr("Button")
Don Gagne's avatar
Don Gagne committed
819 820
                    enabled: false
                }
Don Gagne's avatar
Don Gagne committed
821

Don Gagne's avatar
Don Gagne committed
822 823 824 825 826 827 828 829 830
                // QGCButton - primary
                Loader {
                    sourceComponent: ctlRowHeader
                    property var text: "QGCButton(primary)"
                }
                QGCButton {
                    width: 100
                    height: 20
                    primary: true
Tomaz Canabrava's avatar
Tomaz Canabrava committed
831
                    text: qsTr("Button")
Don Gagne's avatar
Don Gagne committed
832 833 834 835
                }
                QGCButton {
                    width: 100
                    height: 20
Tomaz Canabrava's avatar
Tomaz Canabrava committed
836
                    text: qsTr("Button")
Don Gagne's avatar
Don Gagne committed
837 838 839
                    primary: true
                    enabled: false
                }
840

841 842 843 844 845 846 847 848
                // QGCButton - menu
                Loader {
                    sourceComponent: ctlRowHeader
                    property var text: "QGCButton(menu)"
                }
                Menu {
                    id: buttonMenu
                    MenuItem {
Tomaz Canabrava's avatar
Tomaz Canabrava committed
849
                        text: qsTr("Item 1")
850 851
                    }
                    MenuItem {
Tomaz Canabrava's avatar
Tomaz Canabrava committed
852
                        text: qsTr("Item 2")
853 854
                    }
                    MenuItem {
Tomaz Canabrava's avatar
Tomaz Canabrava committed
855
                        text: qsTr("Item 3")
856 857 858 859 860
                    }
                }
                QGCButton {
                    width: 100
                    height: 20
Tomaz Canabrava's avatar
Tomaz Canabrava committed
861
                    text: qsTr("Button")
862 863 864 865 866
                    menu: buttonMenu
                }
                QGCButton {
                    width: 100
                    height: 20
Tomaz Canabrava's avatar
Tomaz Canabrava committed
867
                    text: qsTr("Button")
868 869 870 871
                    enabled: false
                    menu: buttonMenu
                }

Don Gagne's avatar
Don Gagne committed
872 873 874 875 876 877 878 879
                // QGCRadioButton
                Loader {
                    sourceComponent: ctlRowHeader
                    property var text: "QGCRadioButton"
                }
                QGCRadioButton {
                    width: 100
                    height: 20
Tomaz Canabrava's avatar
Tomaz Canabrava committed
880
                    text: qsTr("Radio")
Don Gagne's avatar
Don Gagne committed
881 882 883 884
                }
                QGCRadioButton {
                    width: 100
                    height: 20
Tomaz Canabrava's avatar
Tomaz Canabrava committed
885
                    text: qsTr("Radio")
Don Gagne's avatar
Don Gagne committed
886 887
                    enabled: false
                }
Don Gagne's avatar
Don Gagne committed
888

Don Gagne's avatar
Don Gagne committed
889 890 891 892 893 894 895 896
                // QGCCheckBox
                Loader {
                    sourceComponent: ctlRowHeader
                    property var text: "QGCCheckBox"
                }
                QGCCheckBox {
                    width: 100
                    height: 20
Tomaz Canabrava's avatar
Tomaz Canabrava committed
897
                    text: qsTr("Check Box")
Don Gagne's avatar
Don Gagne committed
898 899 900 901
                }
                QGCCheckBox {
                    width: 100
                    height: 20
Tomaz Canabrava's avatar
Tomaz Canabrava committed
902
                    text: qsTr("Check Box")
Don Gagne's avatar
Don Gagne committed
903 904
                    enabled: false
                }
Don Gagne's avatar
Don Gagne committed
905

Don Gagne's avatar
Don Gagne committed
906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921
                // QGCTextField
                Loader {
                    sourceComponent: ctlRowHeader
                    property var text: "QGCTextField"
                }
                QGCTextField {
                    width: 100
                    height: 20
                    text: "QGCTextField"
                }
                QGCTextField {
                    width: 100
                    height: 20
                    text: "QGCTextField"
                    enabled: false
                }
922

923 924 925 926 927 928 929 930
                // QGCComboBox
                Loader {
                    sourceComponent: ctlRowHeader
                    property var text: "QGCComboBox"
                }
                QGCComboBox {
                    width: 100
                    height: 20
Tomaz Canabrava's avatar
Tomaz Canabrava committed
931
                    model: [ qsTr("Item 1"), qsTr("Item 2"), qsTr("Item 3") ]
932 933 934 935
                }
                QGCComboBox {
                    width: 100
                    height: 20
Tomaz Canabrava's avatar
Tomaz Canabrava committed
936
                    model: [ qsTr("Item 1"), qsTr("Item 2"), qsTr("Item 3") ]
937 938 939
                    enabled: false
                }

Don Gagne's avatar
Don Gagne committed
940 941 942 943 944 945 946 947
                // SubMenuButton
                Loader {
                    sourceComponent: ctlRowHeader
                    property var text: "SubMenuButton"
                }
                SubMenuButton {
                    width: 100
                    height: 100
Tomaz Canabrava's avatar
Tomaz Canabrava committed
948
                    text: qsTr("SUB MENU")
Don Gagne's avatar
Don Gagne committed
949 950 951 952
                }
                SubMenuButton {
                    width: 100
                    height: 100
Tomaz Canabrava's avatar
Tomaz Canabrava committed
953
                    text: qsTr("SUB MENU")
Don Gagne's avatar
Don Gagne committed
954 955
                    enabled: false
                }
956
            }
Don Gagne's avatar
Don Gagne committed
957
        }
958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980

        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
981 982
    }
}