aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmldesigner/data/merging/test_export_button_template.ui.qml
blob: ac96a076f9ab9a16cc000c941193c59263caebf5 (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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
import QtQuick 2.10
import QtQuick.Templates 2.1 as T
import Home 1.0

T.Button {
    id: control
    width: 296
    height: 538

    font: Constants.font
    implicitWidth: Math.max(
                       background ? background.implicitWidth : 0,
                       contentItem.implicitWidth + leftPadding + rightPadding)
    implicitHeight: Math.max(
                        background ? background.implicitHeight : 0,
                        contentItem.implicitHeight + topPadding + bottomPadding)
    leftPadding: 4
    rightPadding: 4

    background: normalBG
    contentItem: normalContent

    Item {
        id: normalBG
    }
    Item {
        id: normalContent
    }

    Item {
        id: focusedBG
    }
    Item {
        id: focusedContent
    }
    Item {
        id: pressedBG
    }
    Item {
        id: defaultBG
    }

    states: [
        State {
            name: "normal"
            when: !control.down && !control.focus

            PropertyChanges {
                target: focusedBG
                visible: false
            }
            PropertyChanges {
                target: focusedContent
                visible: false
            }
            PropertyChanges {
                target: pressedBG
                visible: false
            }
        },
        State {
            name: "press"
            when: control.down && control.focus
            PropertyChanges {
                target: control
                contentItem: focusedContent
            }

            PropertyChanges {
                target: normalBG
                visible: false
            }

            PropertyChanges {
                target: normalContent
                visible: false
            }

            PropertyChanges {
                target: pressedBG
                visible: true
            }

            PropertyChanges {
                target: focusedContent
                visible: true
            }

            PropertyChanges {
                target: control
                background: pressedBG
            }
        }
    ]
    QtObject {
        id: qds_stylesheet_merger_options
        property bool useStyleSheetPositions: true
    }
}