Debian Codegraph @

src/qml/player/SceneFrame.qml

raw
1 /*
2 * Copyright (C) 2013 Canonical, Ltd.
3 *
4 * Authors:
5 * Renato Araujo Oliveira Filho <[email protected]>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 3.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 import QtQuick 2.4
21 import Lomiri.Components 1.3
22
23 MouseArea {
24 id: _imageFrame
25
26 property int start
27 property int duration
28 property alias source: _image.source
29 property bool active: false
30 readonly property bool ready: (_image.status === Image.Ready)
31
32 Behavior on width {
33 NumberAnimation { duration: 150; easing.type: Easing.InOutQuart }
34 }
35
36 LomiriShape {
37 id: _shape
38 radius: "medium"
39
40 anchors {
41 fill: parent
42 topMargin: active ? 0 : units.gu(2)
43 bottomMargin: active ? 0 : units.gu(2)
44 leftMargin: units.gu(1)
45 rightMargin: units.gu(1)
46
47 Behavior on topMargin {
48 NumberAnimation { duration: 150; easing.type: Easing.InOutQuart }
49 }
50
51 Behavior on bottomMargin {
52 NumberAnimation { duration: 150; easing.type: Easing.InOutQuart }
53 }
54 }
55
56 image: Image {
57 id: _image
58
59 fillMode: Image.PreserveAspectCrop
60 smooth: true
61 asynchronous: true
62 sourceSize.width: _shape.width
63 sourceSize.height: _shape.height
64 }
65 }
66
67 ActivityIndicator {
68 id: imgLoading
69
70 anchors {
71 verticalCenter: _shape.verticalCenter
72 horizontalCenter: _shape.horizontalCenter
73 margins: units.gu(0.5)
74 }
75
76 running: _image.status != Image.Ready
77 visible: running
78 }
79 }