summaryrefslogtreecommitdiffstats
path: root/examples/positioning/satelliteinfo/Button.qml
blob: 19f6a771b769c71c164b7081bbcc4ce8c03830d1 (plain)
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
30
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

import QtQuick
import QtQuick.Controls.Basic

ItemDelegate {
    id: root

    property bool redHover: false
    readonly property color pressedColor: root.redHover ? Theme.buttonRedTextPressedColor
                                                        : Theme.buttonTextPressedColor

    contentItem: Text {
        text: root.text
        font.pixelSize: Theme.mediumFontSize
        font.weight: Theme.fontDefaultWeight
        color: root.pressed ? root.pressedColor : Theme.buttonTextColor
        horizontalAlignment: Text.AlignHCenter
        verticalAlignment: Text.AlignVCenter
    }
    background: Rectangle {
        border {
            width: 2
            color: root.pressed ? root.pressedColor : Theme.buttonTextColor
        }
        radius: 10
        color: Theme.buttonBackgroundColor
    }
}