Skip to content
QGCTabButton.qml 922 B
Newer Older
import QtQuick                      2.11
import QtQuick.Controls             2.4

import QGroundControl               1.0
import QGroundControl.Palette       1.0
import QGroundControl.Controls      1.0
import QGroundControl.ScreenTools   1.0

TabButton {
    id: control
    property bool _showHighlight: (pressed | hovered | checked)
Gus Grubba's avatar
Gus Grubba committed
    QGCPalette { id: qgcPalDisabled; colorGroupEnabled: false }
    background: Rectangle {
Gus Grubba's avatar
Gus Grubba committed
        color:                  enabled ? (_showHighlight ? qgcPal.buttonHighlight : qgcPal.button) : qgcPalDisabled.button
    }
    contentItem: QGCLabel {
        text:                   control.text
Gus Grubba's avatar
Gus Grubba committed
        color:                  enabled ? (_showHighlight ? qgcPal.buttonHighlightText : qgcPal.buttonText) : qgcPalDisabled.buttonText
        horizontalAlignment:    Text.AlignHCenter
        verticalAlignment:      Text.AlignVCenter
        elide:                  Text.ElideRight
    }
}