QmlTest.qml 50.9 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

Rectangle {
11 12 13
    anchors.fill:       parent
    anchors.margins:    ScreenTools.defaultFontPixelWidth
    color:              "white"
14

15
    property var palette: QGCPalette { colorGroupEnabled: true }
Don Gagne's avatar
Don Gagne committed
16

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
    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; }
            }
        }
    }

85 86 87 88 89
    QGCFlickable {
        anchors.fill:           parent
        contentWidth:           _rootCol.width
        contentHeight:          _rootCol.height
        clip:                   true
Don Gagne's avatar
Don Gagne committed
90

91 92
        Column {
            id:         _rootCol
Don Gagne's avatar
Don Gagne committed
93

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

124 125 126 127
            Row {
                spacing: 30

                // Theme preview
Gus Grubba's avatar
Gus Grubba committed
128
                Grid {
129 130
                    columns: 5
                    spacing: 5
Gus Grubba's avatar
Gus Grubba committed
131 132

                    Component {
133
                        id: rowHeader
Gus Grubba's avatar
Gus Grubba committed
134 135

                        Text {
136
                            width: 180
Gus Grubba's avatar
Gus Grubba committed
137 138 139 140 141 142
                            height: 20
                            horizontalAlignment: Text.AlignRight
                            verticalAlignment: Text.AlignVCenter
                            color: "black"
                            text: parent.text
                        }
143
                    }
Gus Grubba's avatar
Gus Grubba committed
144 145 146

                    // Header row
                    Loader {
147
                        sourceComponent: rowHeader
148
                        property string text: ""
149
                    }
Gus Grubba's avatar
Gus Grubba committed
150
                    Text {
151
                        width: 80
Gus Grubba's avatar
Gus Grubba committed
152 153 154
                        height: 20
                        color: "black"
                        horizontalAlignment: Text.AlignHCenter
155
                        text: qsTr("Disabled")
Gus Grubba's avatar
Gus Grubba committed
156 157
                    }
                    Text {
158
                        width: 80
Gus Grubba's avatar
Gus Grubba committed
159 160 161
                        height: 20
                        color: "black"
                        horizontalAlignment: Text.AlignHCenter
162
                        text: qsTr("Enabled")
Gus Grubba's avatar
Gus Grubba committed
163
                    }
164 165
                    Text {
                        width: 80
Gus Grubba's avatar
Gus Grubba committed
166
                        height: 20
167 168 169
                        color: "black"
                        horizontalAlignment: Text.AlignHCenter
                        text: qsTr("Value")
Gus Grubba's avatar
Gus Grubba committed
170
                    }
171 172
                    Text {
                        width: 80
Gus Grubba's avatar
Gus Grubba committed
173
                        height: 20
174 175 176
                        color: "black"
                        horizontalAlignment: Text.AlignHCenter
                        text: qsTr("Value")
Gus Grubba's avatar
Gus Grubba committed
177
                    }
Don Gagne's avatar
Don Gagne committed
178

179
                    // window
Gus Grubba's avatar
Gus Grubba committed
180
                    Loader {
181 182
                        sourceComponent: rowHeader
                        property string text: "window"
Gus Grubba's avatar
Gus Grubba committed
183
                    }
184 185 186 187
                    ClickableColor {
                        property var palette: QGCPalette { colorGroupEnabled: false }
                        color: palette.window
                        onColorSelected: palette.window = color
Gus Grubba's avatar
Gus Grubba committed
188
                    }
189 190 191 192
                    ClickableColor {
                        property var palette: QGCPalette { colorGroupEnabled: true }
                        color: palette.window
                        onColorSelected: palette.window = color
Gus Grubba's avatar
Gus Grubba committed
193
                    }
194 195
                    Text {
                        width: 80
Gus Grubba's avatar
Gus Grubba committed
196
                        height: 20
197 198 199 200
                        color: "black"
                        horizontalAlignment: Text.AlignHCenter
                        property var palette: QGCPalette { colorGroupEnabled: false }
                        text: palette.window
Gus Grubba's avatar
Gus Grubba committed
201
                    }
202 203
                    Text {
                        width: 80
Gus Grubba's avatar
Gus Grubba committed
204
                        height: 20
205 206 207 208
                        color: "black"
                        horizontalAlignment: Text.AlignHCenter
                        property var palette: QGCPalette { colorGroupEnabled: true }
                        text: palette.window
Gus Grubba's avatar
Gus Grubba committed
209
                    }
210

211
                    // windowShade
Gus Grubba's avatar
Gus Grubba committed
212
                    Loader {
213 214
                        sourceComponent: rowHeader
                        property string text: "windowShade"
Gus Grubba's avatar
Gus Grubba committed
215
                    }
216 217 218 219 220 221 222 223 224
                    ClickableColor {
                        property var palette: QGCPalette { colorGroupEnabled: false }
                        color: palette.windowShade
                        onColorSelected: palette.windowShade = color
                    }
                    ClickableColor {
                        property var palette: QGCPalette { colorGroupEnabled: true }
                        color: palette.windowShade
                        onColorSelected: palette.windowShade = color
Gus Grubba's avatar
Gus Grubba committed
225
                    }
226 227
                    Text {
                        width: 80
Gus Grubba's avatar
Gus Grubba committed
228
                        height: 20
229 230 231 232
                        color: "black"
                        horizontalAlignment: Text.AlignHCenter
                        property var palette: QGCPalette { colorGroupEnabled: false }
                        text: palette.windowShade
Gus Grubba's avatar
Gus Grubba committed
233
                    }
234 235
                    Text {
                        width: 80
Gus Grubba's avatar
Gus Grubba committed
236
                        height: 20
237 238 239 240
                        color: "black"
                        horizontalAlignment: Text.AlignHCenter
                        property var palette: QGCPalette { colorGroupEnabled: true }
                        text: palette.windowShade
Gus Grubba's avatar
Gus Grubba committed
241
                    }
242

243
                    // windowShadeDark
Gus Grubba's avatar
Gus Grubba committed
244
                    Loader {
245 246
                        sourceComponent: rowHeader
                        property string text: "windowShadeDark"
Gus Grubba's avatar
Gus Grubba committed
247
                    }
248 249 250 251 252 253 254 255 256 257 258 259
                    ClickableColor {
                        property var palette: QGCPalette { colorGroupEnabled: false }
                        color: palette.windowShadeDark
                        onColorSelected: palette.windowShadeDark = color
                    }
                    ClickableColor {
                        property var palette: QGCPalette { colorGroupEnabled: true }
                        color: palette.windowShadeDark
                        onColorSelected: palette.windowShadeDark = color
                    }
                    Text {
                        width: 80
Gus Grubba's avatar
Gus Grubba committed
260
                        height: 20
261 262 263 264
                        color: "black"
                        horizontalAlignment: Text.AlignHCenter
                        property var palette: QGCPalette { colorGroupEnabled: false }
                        text: palette.windowShadeDark
Gus Grubba's avatar
Gus Grubba committed
265
                    }
266 267
                    Text {
                        width: 80
Gus Grubba's avatar
Gus Grubba committed
268
                        height: 20
269 270 271 272
                        color: "black"
                        horizontalAlignment: Text.AlignHCenter
                        property var palette: QGCPalette { colorGroupEnabled: true }
                        text: palette.windowShadeDark
Gus Grubba's avatar
Gus Grubba committed
273 274
                    }

275
                    // text
Gus Grubba's avatar
Gus Grubba committed
276
                    Loader {
277 278 279 280 281 282 283 284 285 286 287 288
                        sourceComponent: rowHeader
                        property string text: "text"
                    }
                    ClickableColor {
                        property var palette: QGCPalette { colorGroupEnabled: false }
                        color: palette.text
                        onColorSelected: palette.text = color
                    }
                    ClickableColor {
                        property var palette: QGCPalette { colorGroupEnabled: true }
                        color: palette.text
                        onColorSelected: palette.text = color
Gus Grubba's avatar
Gus Grubba committed
289
                    }
290 291
                    Text {
                        width: 80
Gus Grubba's avatar
Gus Grubba committed
292
                        height: 20
293 294 295 296
                        color: "black"
                        horizontalAlignment: Text.AlignHCenter
                        property var palette: QGCPalette { colorGroupEnabled: false }
                        text: palette.text
Gus Grubba's avatar
Gus Grubba committed
297
                    }
298 299
                    Text {
                        width: 80
Gus Grubba's avatar
Gus Grubba committed
300
                        height: 20
301 302 303 304
                        color: "black"
                        horizontalAlignment: Text.AlignHCenter
                        property var palette: QGCPalette { colorGroupEnabled: true }
                        text: palette.text
Gus Grubba's avatar
Gus Grubba committed
305 306
                    }

307
                    // button
Gus Grubba's avatar
Gus Grubba committed
308
                    Loader {
309 310 311 312 313 314 315 316 317 318 319 320
                        sourceComponent: rowHeader
                        property string text: "button"
                    }
                    ClickableColor {
                        property var palette: QGCPalette { colorGroupEnabled: false }
                        color: palette.button
                        onColorSelected: palette.button = color
                    }
                    ClickableColor {
                        property var palette: QGCPalette { colorGroupEnabled: true }
                        color: palette.button
                        onColorSelected: palette.button = color
Gus Grubba's avatar
Gus Grubba committed
321
                    }
322 323
                    Text {
                        width: 80
Gus Grubba's avatar
Gus Grubba committed
324
                        height: 20
325 326 327 328
                        color: "black"
                        horizontalAlignment: Text.AlignHCenter
                        property var palette: QGCPalette { colorGroupEnabled: false }
                        text: palette.button
Gus Grubba's avatar
Gus Grubba committed
329
                    }
330 331
                    Text {
                        width: 80
Gus Grubba's avatar
Gus Grubba committed
332
                        height: 20
333 334 335 336
                        color: "black"
                        horizontalAlignment: Text.AlignHCenter
                        property var palette: QGCPalette { colorGroupEnabled: true }
                        text: palette.button
Gus Grubba's avatar
Gus Grubba committed
337 338
                    }

339
                    // buttonText
Gus Grubba's avatar
Gus Grubba committed
340
                    Loader {
341 342 343 344 345 346 347 348 349 350 351 352
                        sourceComponent: rowHeader
                        property string text: "buttonText"
                    }
                    ClickableColor {
                        property var palette: QGCPalette { colorGroupEnabled: false }
                        color: palette.buttonText
                        onColorSelected: palette.buttonText = color
                    }
                    ClickableColor {
                        property var palette: QGCPalette { colorGroupEnabled: true }
                        color: palette.buttonText
                        onColorSelected: palette.buttonText = color
Gus Grubba's avatar
Gus Grubba committed
353
                    }
354 355
                    Text {
                        width: 80
Gus Grubba's avatar
Gus Grubba committed
356
                        height: 20
357 358 359 360
                        color: "black"
                        horizontalAlignment: Text.AlignHCenter
                        property var palette: QGCPalette { colorGroupEnabled: false }
                        text: palette.buttonText
Gus Grubba's avatar
Gus Grubba committed
361
                    }
362 363
                    Text {
                        width: 80
Gus Grubba's avatar
Gus Grubba committed
364
                        height: 20
365 366 367 368
                        color: "black"
                        horizontalAlignment: Text.AlignHCenter
                        property var palette: QGCPalette { colorGroupEnabled: true }
                        text: palette.buttonText
Gus Grubba's avatar
Gus Grubba committed
369 370
                    }

371
                    // buttonHighlight
Gus Grubba's avatar
Gus Grubba committed
372
                    Loader {
373 374
                        sourceComponent: rowHeader
                        property string text: "buttonHighlight"
Gus Grubba's avatar
Gus Grubba committed
375
                    }
376 377 378 379
                    ClickableColor {
                        property var palette: QGCPalette { colorGroupEnabled: false }
                        color: palette.buttonHighlight
                        onColorSelected: palette.buttonHighlight = color
Gus Grubba's avatar
Gus Grubba committed
380
                    }
381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400
                    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
                        property var palette: QGCPalette { colorGroupEnabled: true }
                        text: palette.buttonHighlight
Gus Grubba's avatar
Gus Grubba committed
401
                    }
402

403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433
                    // buttonHighlightText
                    Loader {
                        sourceComponent: rowHeader
                        property string text: "buttonHighlightText"
                    }
                    ClickableColor {
                        property var palette: QGCPalette { colorGroupEnabled: false }
                        color: palette.buttonHighlightText
                        onColorSelected: palette.buttonHighlightText = color
                    }
                    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
                        property var palette: QGCPalette { colorGroupEnabled: true }
                        text: palette.buttonHighlightText
                    }
434

435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 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 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 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 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 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 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 1003 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 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172
                    // primaryButton
                    Loader {
                        sourceComponent: rowHeader
                        property string text: "primaryButton"
                    }
                    ClickableColor {
                        property var palette: QGCPalette { colorGroupEnabled: false }
                        color: palette.primaryButton
                        onColorSelected: palette.primaryButton = color
                    }
                    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
                        property var palette: QGCPalette { colorGroupEnabled: true }
                        text: palette.primaryButton
                    }

                    // primaryButtonText
                    Loader {
                        sourceComponent: rowHeader
                        property string text: "primaryButtonText"
                    }
                    ClickableColor {
                        property var palette: QGCPalette { colorGroupEnabled: false }
                        color: palette.primaryButtonText
                        onColorSelected: palette.primaryButtonText = color
                    }
                    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
                        property var palette: QGCPalette { colorGroupEnabled: true }
                        text: palette.primaryButtonText
                    }

                    // textField
                    Loader {
                        sourceComponent: rowHeader
                        property string text: "textField"
                    }
                    ClickableColor {
                        property var palette: QGCPalette { colorGroupEnabled: false }
                        color: palette.textField
                        onColorSelected: palette.textField = color
                    }
                    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
                        property var palette: QGCPalette { colorGroupEnabled: true }
                        text: palette.textField
                    }

                    // textFieldText
                    Loader {
                        sourceComponent: rowHeader
                        property string text: "textFieldText"
                    }
                    ClickableColor {
                        property var palette: QGCPalette { colorGroupEnabled: false }
                        color: palette.textFieldText
                        onColorSelected: palette.textFieldText = color
                    }
                    ClickableColor {
                        property var palette: QGCPalette { colorGroupEnabled: true }
                        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
                    }

                    // warningText
                    Loader {
                        sourceComponent: rowHeader
                        property string 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
                    }

                    // colorGreen
                    Loader {
                        sourceComponent: rowHeader
                        property string 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 string 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 string 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 string 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 string 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
                    }

                    // alertBackground
                    Loader {
                        sourceComponent: rowHeader
                        property string 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
                    }
                    Text {
                        width: 80
                        height: 20
                        color: "black"
                        horizontalAlignment: Text.AlignHCenter
                        property var palette: QGCPalette { colorGroupEnabled: false }
                        text: palette.alertBackground
                    }
                    Text {
                        width: 80
                        height: 20
                        color: "black"
                        horizontalAlignment: Text.AlignHCenter
                        property var palette: QGCPalette { colorGroupEnabled: true }
                        text: palette.alertBackground
                    }

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

                    // alertText
                    Loader {
                        sourceComponent: rowHeader
                        property string text: "alertText"
                    }
                    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
                        height: 20
                        color: "black"
                        horizontalAlignment: Text.AlignHCenter
                        property var palette: QGCPalette { colorGroupEnabled: false }
                        text: palette.alertText
                    }
                    Text {
                        width: 80
                        height: 20
                        color: "black"
                        horizontalAlignment: Text.AlignHCenter
                        property var palette: QGCPalette { colorGroupEnabled: true }
                        text: palette.alertText
                    }

                    // missionItemEditor
                    Loader {
                        sourceComponent: rowHeader
                        property string 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
                    }

                } // Theme preview

                // QGC controls preview
                Column {
                    id: ctlPrevColumn
                    property real _width: ScreenTools.defaultFontPointSize * 18
                    property real _height: _width*0.15
                    property color _bkColor: qgcPal.window
                    spacing: 10
                    width: previewGrid.width
                    Grid {
                        id: previewGrid
                        columns: 3
                        spacing: 10

                        Component {
                            id: ctlRowHeader

                            Rectangle {
                                width: ctlPrevColumn._width
                                height: ctlPrevColumn._height
                                color: "white"
                                Text {
                                    anchors.fill: parent
                                    horizontalAlignment: Text.AlignRight
                                    verticalAlignment: Text.AlignVCenter
                                    color: "black"

                                    text: parent.parent.text
                                }
                            }
                        }

                        // Header row
                        Text {
                            width: ctlPrevColumn._width
                            height: ctlPrevColumn._height
                            color: "black"
                            horizontalAlignment: Text.AlignHCenter
                            text: qsTr("QGC name")
                        }
                        Text {
                            width: ctlPrevColumn._width
                            height: ctlPrevColumn._height
                            color: "black"
                            horizontalAlignment: Text.AlignHCenter
                            text: qsTr("Enabled")
                        }
                        Text {
                            width: ctlPrevColumn._width
                            height: ctlPrevColumn._height
                            color: "black"
                            horizontalAlignment: Text.AlignHCenter
                            text: qsTr("Disabled")
                        }

                        // QGCLabel
                        Loader {
                            sourceComponent: ctlRowHeader
                            property string text: "QGCLabel"
                        }
                        Rectangle {
                            width: ctlPrevColumn._width
                            height: ctlPrevColumn._height
                            color: ctlPrevColumn._bkColor
                            QGCLabel {
                                anchors.fill: parent
                                anchors.margins: 5
                                text: qsTr("Label")
                            }
                        }
                        Rectangle {
                            width: ctlPrevColumn._width
                            height: ctlPrevColumn._height
                            color: ctlPrevColumn._bkColor
                            QGCLabel {
                                anchors.fill: parent
                                anchors.margins: 5
                                text: qsTr("Label")
                                enabled: false
                            }
                        }

                        // QGCButton
                        Loader {
                            sourceComponent: ctlRowHeader
                            property string text: "QGCButton"
                        }
                        QGCButton {
                            width: ctlPrevColumn._width
                            height: ctlPrevColumn._height
                            text: qsTr("Button")
                        }
                        QGCButton {
                            width: ctlPrevColumn._width
                            height: ctlPrevColumn._height
                            text: qsTr("Button")
                            enabled: false
                        }

                        // QGCButton - primary
                        Loader {
                            sourceComponent: ctlRowHeader
                            property string text: "QGCButton(primary)"
                        }
                        QGCButton {
                            width: ctlPrevColumn._width
                            height: ctlPrevColumn._height
                            primary: true
                            text: qsTr("Button")
                        }
                        QGCButton {
                            width: ctlPrevColumn._width
                            height: ctlPrevColumn._height
                            text: qsTr("Button")
                            primary: true
                            enabled: false
                        }

                        // QGCHoverButton
                        Loader {
                            sourceComponent: ctlRowHeader
                            property string text: "QGCHoverButton"
                        }
                        QGCHoverButton {
                            width: ctlPrevColumn._width
                            height: ctlPrevColumn._height * 2
                            text: qsTr("Hover Button")
                            radius: ScreenTools.defaultFontPointSize
                            imageSource: "/qmlimages/Gears.svg"
                        }
                        QGCHoverButton {
                            width: ctlPrevColumn._width
                            height: ctlPrevColumn._height * 2
                            text: qsTr("Hover Button")
                            radius: ScreenTools.defaultFontPointSize
                            imageSource: "/qmlimages/Gears.svg"
                            enabled: false
                        }

                        // QGCButton - menu
                        Loader {
                            sourceComponent: ctlRowHeader
                            property string text: "QGCButton(menu)"
                        }
                        Menu {
                            id: buttonMenu
                            MenuItem {
                                text: qsTr("Item 1")
                            }
                            MenuItem {
                                text: qsTr("Item 2")
                            }
                            MenuItem {
                                text: qsTr("Item 3")
                            }
                        }
                        QGCButton {
                            width: ctlPrevColumn._width
                            height: ctlPrevColumn._height
                            text: qsTr("Button")
                            menu: buttonMenu
                        }
                        QGCButton {
                            width: ctlPrevColumn._width
                            height: ctlPrevColumn._height
                            text: qsTr("Button")
                            enabled: false
                            menu: buttonMenu
                        }

                        // QGCRadioButton
                        Loader {
                            sourceComponent: ctlRowHeader
                            property string text: "QGCRadioButton"
                        }
                        Rectangle {
                            width: ctlPrevColumn._width
                            height: ctlPrevColumn._height
                            color: ctlPrevColumn._bkColor
                            QGCRadioButton {
                                anchors.fill: parent
                                anchors.margins: 5
                                text: qsTr("Radio")
                            }
                        }
                        Rectangle {
                            width: ctlPrevColumn._width
                            height: ctlPrevColumn._height
                            color: ctlPrevColumn._bkColor
                            QGCRadioButton {
                                anchors.fill: parent
                                anchors.margins: 5
                                text: qsTr("Radio")
                                enabled: false
                            }
                        }

                        // QGCCheckBox
                        Loader {
                            sourceComponent: ctlRowHeader
                            property string text: "QGCCheckBox"
                        }
                        Rectangle {
                            width: ctlPrevColumn._width
                            height: ctlPrevColumn._height
                            color: ctlPrevColumn._bkColor
                            QGCCheckBox {
                                anchors.fill: parent
                                anchors.margins: 5
                                text: qsTr("Check Box")
                            }
                        }
                        Rectangle {
                            width: ctlPrevColumn._width
                            height: ctlPrevColumn._height
                            color: ctlPrevColumn._bkColor
                            QGCCheckBox {
                                anchors.fill: parent
                                anchors.margins: 5
                                text: qsTr("Check Box")
                                enabled: false
                            }
                        }

                        // QGCTextField
                        Loader {
                            sourceComponent: ctlRowHeader
                            property string text: "QGCTextField"
                        }
                        QGCTextField {
                            width: ctlPrevColumn._width
                            height: ctlPrevColumn._height
                            text: "QGCTextField"
                        }
                        QGCTextField {
                            width: ctlPrevColumn._width
                            height: ctlPrevColumn._height
                            text: "QGCTextField"
                            enabled: false
                        }

                        // QGCComboBox
                        Loader {
                            sourceComponent: ctlRowHeader
                            property string text: "QGCComboBox"
                        }
                        QGCComboBox {
                            width: ctlPrevColumn._width
                            height: ctlPrevColumn._height
                            model: [ qsTr("Item 1"), qsTr("Item 2"), qsTr("Item 3") ]
                        }
                        QGCComboBox {
                            width: ctlPrevColumn._width
                            height: ctlPrevColumn._height
                            model: [ qsTr("Item 1"), qsTr("Item 2"), qsTr("Item 3") ]
                            enabled: false
                        }

                        // SubMenuButton
                        Loader {
                            sourceComponent: ctlRowHeader
                            property string text: "SubMenuButton"
                        }
                        SubMenuButton {
                            width: ctlPrevColumn._width
                            height: ctlPrevColumn._width/3
                            text: qsTr("SUB MENU")
                        }
                        SubMenuButton {
                            width: ctlPrevColumn._width
                            height: ctlPrevColumn._width/3
                            text: qsTr("SUB MENU")
                            enabled: false
                        }
                    }
                    Rectangle {
                        width:  previewGrid.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
                        }
                    }
                } // QGC controls preview
1173
            }
1174 1175 1176 1177

            Item{
                height: 10;
                width:  1;
1178
            }
1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194

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

1197 1198
        }

Don Gagne's avatar
Don Gagne committed
1199 1200
    }
}