QGCTabButton.qml 922 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11
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
12
    QGCPalette { id: qgcPalDisabled; colorGroupEnabled: false }
13
    background: Rectangle {
Gus Grubba's avatar
Gus Grubba committed
14
        color:                  enabled ? (_showHighlight ? qgcPal.buttonHighlight : qgcPal.button) : qgcPalDisabled.button
15 16 17
    }
    contentItem: QGCLabel {
        text:                   control.text
Gus Grubba's avatar
Gus Grubba committed
18
        color:                  enabled ? (_showHighlight ? qgcPal.buttonHighlightText : qgcPal.buttonText) : qgcPalDisabled.buttonText
19 20 21 22 23
        horizontalAlignment:    Text.AlignHCenter
        verticalAlignment:      Text.AlignVCenter
        elide:                  Text.ElideRight
    }
}