summary refs log tree commit diff
path: root/resources/qml/components/NhekoTabButton.qml
blob: 796177e8d9db825d7ea3eb1e11ef784bb62c387a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// SPDX-FileCopyrightText: Nheko Contributors
//
// SPDX-License-Identifier: GPL-3.0-or-later

import QtQuick 2.15
import QtQuick.Controls 2.15
import im.nheko 1.0

TabButton {
    id: control

    contentItem: Text {
        text: control.text
        font: control.font
        opacity: enabled ? 1.0 : 0.3
        color: control.down ? palette.highlightedText : palette.text
        horizontalAlignment: Text.AlignHCenter
        verticalAlignment: Text.AlignVCenter
        elide: Text.ElideRight
    }

    background: Rectangle {
        border.color: control.down ? palette.highlight : Nheko.theme.separator
        color: control.checked ? palette.highlight : palette.base
        border.width: 1
        radius: 2
    }
}