2 * Copyright (C) 2013 Canonical, Ltd.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 import Ubuntu.Components 0.1
19 import "../Components"
23 property real yOffsetAtAnimationStart: units.gu(2)
24 property real progress: 0
25 property int animationDuration: 200
26 default property alias __itemsToAnimate: container.children
28 property bool showing: progress > 0
30 height: childrenRect.height
38 height: childrenRect.height
41 NumberAnimation {id: opacityAnimation; target: container; property: "opacity"; from: 0; to: 1; duration: animationDuration}
42 NumberAnimation {id: yAnimation; target: container; property: "y"; from: yOffsetAtAnimationStart; to: 0; duration: animationDuration}
44 // FIXME This would much more sense in a ParallelAnimation and just
45 // one AnimationController but that goes something crazy and rendering never stops
47 animation: opacityAnimation
48 progress: root.progress
52 progress: root.progress