QGCTabButton.qml 1 KB
Newer Older
1 2 3 4
import QtQuick                      2.12
import QtQuick.Controls             2.12
import QtQuick.Controls.impl        2.12
import QtQml                        2.12
5 6 7 8 9 10 11

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

TabButton {
12 13 14 15
    id:             control
    font.pointSize: ScreenTools.defaultFontPointSize
    font.family:    ScreenTools.normalFontFamily

16
    property bool _showHighlight: (pressed | hovered | checked)
17 18 19 20 21 22 23 24 25 26 27

    QGCPalette { id: qgcPal; colorGroupEnabled: enabled }

    contentItem: IconLabel {
        spacing:    control.spacing
        mirrored:   control.mirrored
        display:    control.display
        icon:       control.icon
        text:       control.text
        font:       control.font
        color:      _showHighlight ? qgcPal.buttonHighlightText : qgcPal.buttonText
28
    }
29 30 31

    background: Rectangle {
        color: _showHighlight ? qgcPal.buttonHighlight : qgcPal.button
32 33
    }
}