aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/studiowelcome/qml/welcomepage/MyButton.qml
blob: 8a4cec4ae59305656375c1f21864c50b1d7cb372 (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
31
32
33
34
35
36
37
// Copyright (C) 2019 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

import QtQuick 2.9
import QtQuick.Templates 2.3
import welcome 1.0
import StudioFonts 1.0

Button {
    id: button

    property color hoverColor: Constants.textHoverColor
    property color defaultColor: Constants.textDefaultColor
    property color checkedColor: Constants.textDefaultColor

    text: "test"

    implicitWidth: background.width
    implicitHeight: background.height

    contentItem: Text {
        id: textButton
        text: button.text

        color: checked ? button.checkedColor :
                         button.hovered ? button.hoverColor :
                                          button.defaultColor
        font.family: StudioFonts.titilliumWeb_regular
        renderType: Text.NativeRendering
        font.pixelSize: 18
    }

    background: Item {
        width: textButton.implicitWidth
        height: textButton.implicitHeight
    }
}