Skip to content
Snippets Groups Projects
QGCButton.qml 808 B
Newer Older
  • Learn to ignore specific revisions
  • Don Gagne's avatar
    Don Gagne committed
    import QtQuick 2.2
    import QtQuick.Controls 1.2
    import QtQuick.Controls.Styles 1.2
    
    import QGroundControl.Palette 1.0
    
    Button {
        property var __qgcPal: QGCPalette { colorGroup: enabled ? QGCPalette.Active : QGCPalette.Disabled }
    
        style: ButtonStyle {
                background: Rectangle {
                    implicitWidth: 100
                    implicitHeight: 25
    
                    color: control.pressed ? control.__qgcPal.buttonHighlight : control.__qgcPal.button
    
    Don Gagne's avatar
    Don Gagne committed
                }
    
                label: Text {
                    width: parent.width
                    height: parent.height
    
                    verticalAlignment: TextEdit.AlignVCenter
                    horizontalAlignment: TextEdit.AlignHCenter
    
                    text: control.text
                    color: control.__qgcPal.buttonText
                }
            }
    }