tests/auto/declarative/qmlvisual/animation/qtbug13398/qtbug13398.qml
changeset 37 758a864f9613
equal deleted inserted replaced
36:ef0373b55136 37:758a864f9613
       
     1 import Qt 4.7
       
     2 
       
     3 Item {
       
     4     width: 300
       
     5     height: 400
       
     6 
       
     7     Rectangle {
       
     8         id: root
       
     9         color: "darkkhaki"
       
    10 
       
    11         x: 50
       
    12         y: 50
       
    13 
       
    14         width: 200
       
    15         height: 300
       
    16 
       
    17         Rectangle {
       
    18             id: statusbar
       
    19             color: "chocolate"
       
    20 
       
    21             height: 30
       
    22 
       
    23             anchors.top: root.top
       
    24             anchors.left: root.left
       
    25             anchors.right: root.right
       
    26         }
       
    27 
       
    28         Rectangle {
       
    29             id: titlebar
       
    30             color: "crimson"
       
    31 
       
    32             height: 60
       
    33 
       
    34             anchors.top: statusbar.bottom
       
    35             anchors.left: root.left
       
    36             anchors.right: root.right
       
    37         }
       
    38 
       
    39         MouseArea {
       
    40             anchors.fill: parent
       
    41             onClicked: {
       
    42                 root.state = root.state ? "" : "fullscreen";
       
    43             }
       
    44         }
       
    45 
       
    46         states: [
       
    47             State {
       
    48                 name: "fullscreen"
       
    49                 AnchorChanges {
       
    50                     target: statusbar
       
    51                     anchors.top: undefined
       
    52                     anchors.bottom: titlebar.top
       
    53                 }
       
    54                 AnchorChanges {
       
    55                     target: titlebar
       
    56                     anchors.top: undefined
       
    57                     anchors.bottom: root.top
       
    58                 }
       
    59             }
       
    60         ]
       
    61 
       
    62         transitions: [
       
    63             Transition {
       
    64                 AnchorAnimation { }
       
    65             }
       
    66         ]
       
    67     }
       
    68 }