QGCTabButton.qml 782 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
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)
    background: Rectangle {
        color:                  _showHighlight ? qgcPal.buttonHighlight : qgcPal.button
    }
    contentItem: QGCLabel {
        text:                   control.text
        color:                  _showHighlight ? qgcPal.buttonHighlightText : qgcPal.buttonText
        horizontalAlignment:    Text.AlignHCenter
        verticalAlignment:      Text.AlignVCenter
        elide:                  Text.ElideRight
    }
}