2 * Copyright (C) 2013-2016 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/>.
18import Lomiri.Components 1.3
24 property alias arrow: arrow
25 property alias label: label
26 property alias background: background
27 property alias mouseArea: mouseArea
28 property real opacityOverride: 1
39 property bool showOnUnpause
45 opacity: Math.max(Math.min(_showOpacity, opacityOverride), 0)
46 onOpacityOverrideChanged: {
47 if (opacityOverride <= 0) {
48 d.showOnUnpause = false;
52 property real _showOpacity: 0
55 if (paused && shown) {
56 d.showOnUnpause = true;
58 } else if (!paused && d.showOnUnpause) {
61 } else if (hideAnimation.running) {
64 d.showOnUnpause = false;
68 showAnimation: StandardAnimation {
69 property: "_showOpacity"
72 duration: LomiriAnimation.SleepyDuration
73 onStarted: root.visible = true
76 hideAnimation: StandardAnimation {
77 property: "_showOpacity"
79 duration: LomiriAnimation.BriskDuration
82 if (!d.showOnUnpause) {
88 MouseArea { // eat any errant presses
95 // Use x/y/height/width instead of anchors so that we don't adjust
96 // the image if the OSK appears.
101 fillMode: Image.PreserveAspectCrop
107 source: Qt.resolvedUrl("graphics/arrow.svg")
108 fillMode: Image.PreserveAspectFit
114 objectName: "tutorialLabel"
116 font.weight: Font.Light