Debian Codegraph @

src/qml/player/TimeLabel.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 import "../sdk"
23
24 Label {
25 id: _TimeLabel
26 objectName: "TimeLine.TimeLabel"
27
28 property string currentTime
29 property string remainingTime
30
31 color: "#e8e1d0"
32 fontSize: "small"
33 state: "PROGRESSIVE"
34 verticalAlignment: Text.AlignVCenter
35 horizontalAlignment: Text.AlignRight
36
37 states: [
38 State {
39 name: "PROGRESSIVE"
40 PropertyChanges { target: _TimeLabel; text: _TimeLabel.currentTime }
41 },
42 State {
43 name: "DEGRESSIVE"
44 PropertyChanges { target: _TimeLabel; text: "- %1".arg(_TimeLabel.remainingTime) }
45 }
46 ]
47
48 MouseArea {
49 anchors.fill: parent
50 onClicked: {
51 if (_TimeLabel.state === "PROGRESSIVE") {
52 _TimeLabel.state = "DEGRESSIVE"
53 } else {
54 _TimeLabel.state = "PROGRESSIVE"
55 }
56 }
57 }
58 }