Skip to content
QmlTest.qml 50.9 KiB
Newer Older
import QtQuick 2.3
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.4
import QtQuick.Layouts          1.2
Don Gagne's avatar
Don Gagne committed

import QGroundControl.Palette       1.0
import QGroundControl.Controls      1.0
import QGroundControl.ScreenTools   1.0
Don Gagne's avatar
Don Gagne committed

Rectangle {
    anchors.fill:       parent
    anchors.margins:    ScreenTools.defaultFontPixelWidth
    color:              "white"
    property var palette: QGCPalette { colorGroupEnabled: true }
Don Gagne's avatar
Don Gagne committed

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

    QGCFlickable {
        anchors.fill:           parent
        contentWidth:           _rootCol.width
        contentHeight:          _rootCol.height
        clip:                   true
Don Gagne's avatar
Don Gagne committed

Don Gagne's avatar
Don Gagne committed

            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
                    }
                }
Gus Grubba's avatar
Gus Grubba committed
                Grid {
Gus Grubba's avatar
Gus Grubba committed

                    Component {
Gus Grubba's avatar
Gus Grubba committed
                            height: 20
                            horizontalAlignment: Text.AlignRight
                            verticalAlignment: Text.AlignVCenter
                            color: "black"
                            text: parent.text
                        }
Gus Grubba's avatar
Gus Grubba committed

                    // Header row
                    Loader {
                        property string text: ""
Gus Grubba's avatar
Gus Grubba committed
                    Text {
Gus Grubba's avatar
Gus Grubba committed
                        height: 20
                        color: "black"
                        horizontalAlignment: Text.AlignHCenter
Gus Grubba's avatar
Gus Grubba committed
                    }
                    Text {
Gus Grubba's avatar
Gus Grubba committed
                        height: 20
                        color: "black"
                        horizontalAlignment: Text.AlignHCenter
Gus Grubba's avatar
Gus Grubba committed
                        height: 20
                        color: "black"
                        horizontalAlignment: Text.AlignHCenter
                        text: qsTr("Value")
Gus Grubba's avatar
Gus Grubba committed
                        height: 20
                        color: "black"
                        horizontalAlignment: Text.AlignHCenter
                        text: qsTr("Value")
Don Gagne's avatar
Don Gagne committed

Gus Grubba's avatar
Gus Grubba committed
                    Loader {
                        sourceComponent: rowHeader
                        property string text: "window"
                    ClickableColor {
                        property var palette: QGCPalette { colorGroupEnabled: false }
                        color: palette.window
                        onColorSelected: palette.window = color
                    ClickableColor {
                        property var palette: QGCPalette { colorGroupEnabled: true }
                        color: palette.window
                        onColorSelected: palette.window = color
Gus Grubba's avatar
Gus Grubba committed
                        height: 20
                        color: "black"
                        horizontalAlignment: Text.AlignHCenter
                        property var palette: QGCPalette { colorGroupEnabled: false }
                        text: palette.window
Loading
Loading full blame...