| 1 |
/* |
| 2 |
* Copyright (C) 2014 Canonical Ltd. |
| 3 |
* |
| 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. |
| 7 |
* |
| 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. |
| 12 |
* |
| 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/>. |
| 15 |
*/ |
| 16 |
|
| 17 |
import QtQuick 2.12 |
| 18 |
import Lomiri.Components 1.3 |
| 19 |
|
| 20 |
Image { |
| 21 |
id: focusRing |
| 22 |
|
| 23 |
property point center |
| 24 |
function show() { |
| 25 |
hideTimer.restart(); |
| 26 |
rotationAnimation.restart(); |
| 27 |
opacity = 1.0; |
| 28 |
} |
| 29 |
|
| 30 |
x: center.x - width / 2.0 |
| 31 |
y: center.y - height / 2.0 |
| 32 |
width: units.gu(11) |
| 33 |
height: units.gu(11) |
| 34 |
source: "../../assets/focus_ring.png" |
| 35 |
asynchronous: true |
| 36 |
cache: false |
| 37 |
|
| 38 |
opacity: 0.0 |
| 39 |
Behavior on opacity { LomiriNumberAnimation {} } |
| 40 |
|
| 41 |
Timer { |
| 42 |
id: hideTimer |
| 43 |
interval: 1000 |
| 44 |
onTriggered: focusRing.opacity = 0.0; |
| 45 |
} |
| 46 |
|
| 47 |
RotationAnimator { |
| 48 |
id: rotationAnimation |
| 49 |
target: focusRing |
| 50 |
from: 0 |
| 51 |
to: 90 |
| 52 |
duration: LomiriAnimation.SleepyDuration |
| 53 |
easing: LomiriAnimation.StandardEasing |
| 54 |
} |
| 55 |
} |