summaryrefslogtreecommitdiffstats
path: root/examples/declarative/anchors/anchor-changes.qml
blob: 89964390c2d348b53f52f8ad8d9af0d1a1cbf4c7 (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
import Qt 4.6

Item {
    id: Window
    width: 200; height: 450

    Rectangle {
        id: TitleBar; color: "Gray"
        anchors.top: parent.top; height: 50
        width: parent.width
    }

    Rectangle {
        id: StatusBar; color: "Gray"
        height: 50; anchors.bottom: parent.bottom
        width: parent.width
    }

    Rectangle {
        id: Content
        anchors.top: TitleBar.bottom; anchors.bottom: StatusBar.top
        width: parent.width

        Text { text: "Top"; anchors.top: parent.top }
        Text { text: "Bottom"; anchors.bottom: parent.bottom }
    }

    MouseRegion {
        anchors.fill: Content
        onPressed: Window.state = "FullScreen"
        onReleased: Window.state = ""
    }

    states : State {
        name: "FullScreen"
    //! [0]
        AnchorChanges {
            target: Content; top: Window.top; bottom: Window.bottom
        }
    //! [0]
    }

    transitions : Transition {
        NumberAnimation { properties: "y,height" }
    }
}