Welcome to mirror list, hosted at ThFree Co, Russian Federation.

ToolboxTabButton.qml « components « qml « resources « Toolbox « plugins - github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7a7d2be48a1b900efd3a77cdd61b8628c443353e (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// Copyright (c) 2018 Ultimaker B.V.
// Toolbox is released under the terms of the LGPLv3 or higher.

import QtQuick 2.10
import QtQuick.Controls 2.3
import UM 1.1 as UM

Button
{
    id: control
    property bool active: false

    implicitWidth: UM.Theme.getSize("toolbox_header_tab").width
    implicitHeight: UM.Theme.getSize("toolbox_header_tab").height

    background: Item
    {
        id: backgroundItem
        Rectangle
        {
            id: highlight

            visible: control.active
            color: UM.Theme.getColor("primary")
            anchors.bottom: parent.bottom
            width: parent.width
            height: UM.Theme.getSize("toolbox_header_highlight").height
        }
    }

    contentItem: Label
    {
        id: label
        text: control.text
        color: UM.Theme.getColor("toolbox_header_button_text_inactive")
        font: UM.Theme.getFont("medium")

        verticalAlignment: Text.AlignVCenter
        horizontalAlignment: Text.AlignHCenter

        renderType: Text.NativeRendering
    }

    states:
    [
        State
        {
            name: "disabled"
            when: !control.enabled
            PropertyChanges
            {
                target: label
                font: UM.Theme.getFont("default_italic")
            }
        },
        State
        {
            name: "active"
            when: control.active
            PropertyChanges
            {
                target: label
                font: UM.Theme.getFont("medium_bold")
                color: UM.Theme.getColor("action_button_text")
            }
        }
    ]
}