~robertcarr/unity/phablet-integrate-mir-api-changes

« back to all changes in this revision

Viewing changes to testRevealer.qml

  • Committer: Vesa Rautiainen
  • Date: 2012-10-22 18:24:10 UTC
  • mfrom: (28.1.12 demo)
  • Revision ID: vesa.rautiainen@canonical.com-20121022182410-8s3zhi734foof60h
Merge from branch where side stage was developed

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
import Widgets 0.1
3
3
 
4
4
Item {
5
 
    width: units.dp(800/1.5)
 
5
    width: units.dp(600)
6
6
    height: units.dp(400)
7
7
 
8
 
    Revealer {
9
 
        id: revealer
10
 
 
11
 
        anchors {
12
 
            left: redRectangle.left
13
 
            right: redRectangle.right
14
 
        }
15
 
        height: redRectangle.height
16
 
        target: redRectangle
17
 
        handleSize: handle.height
18
 
        hintDisplacement: handle.height
19
 
        orientation: Qt.Vertical
20
 
    }
21
 
 
22
 
    Showable {
23
 
        id: redRectangle
24
 
 
25
 
        anchors.horizontalCenter: parent.horizontalCenter
26
 
        width: parent.height * 0.9
27
 
        height: units.dp(200/1.5)
28
 
 
29
 
        shown: false
30
 
        showAnimation: SmoothedAnimation {
31
 
            property: "y"
32
 
            velocity: revealer.dragVelocity
33
 
            duration: 200
34
 
            to: revealer.openedValue
35
 
        }
36
 
        hideAnimation: SmoothedAnimation {
37
 
            property: "y"
38
 
            velocity: revealer.dragVelocity
39
 
            duration: 200
40
 
            to: revealer.closedValue
41
 
        }
42
 
 
43
 
        Rectangle {
44
 
            anchors.fill: parent
45
 
            color: "red"
46
 
        }
47
 
 
48
 
        Rectangle {
49
 
            id: handle
50
 
 
51
 
            anchors {
52
 
                bottom: parent.bottom
53
 
                left: parent.left
54
 
                right: parent.right
55
 
            }
56
 
            height: units.dp(20/1.5)
57
 
            color: "black"
58
 
        }
 
8
    Units {
 
9
        id: units
 
10
    }
 
11
 
 
12
    RevealingRectangle {
 
13
        anchors.fill: parent
 
14
        orientation: Qt.Vertical
 
15
        direction: Qt.LeftToRight
 
16
    }
 
17
 
 
18
    RevealingRectangle {
 
19
        anchors.fill: parent
 
20
        orientation: Qt.Vertical
 
21
        direction: Qt.RightToLeft
 
22
    }
 
23
 
 
24
    RevealingRectangle {
 
25
        anchors.fill: parent
 
26
        orientation: Qt.Horizontal
 
27
        direction: Qt.LeftToRight
 
28
    }
 
29
 
 
30
    RevealingRectangle {
 
31
        anchors.fill: parent
 
32
        orientation: Qt.Horizontal
 
33
        direction: Qt.RightToLeft
59
34
    }
60
35
}