Changeset View
Changeset View
Standalone View
Standalone View
org.kde.desktop/BusyIndicator.qml
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | * Copyright 2018 Oleg Chernovskiy <adonai@xaker.ru> | ||||
3 | * Copyright 2018 The Qt Company Ltd. | ||||
4 | * | ||||
5 | * GNU Lesser General Public License Usage | ||||
6 | * Alternatively, this file may be used under the terms of the GNU Lesser | ||||
7 | * General Public License version 3 as published by the Free Software | ||||
8 | * Foundation and appearing in the file LICENSE.LGPLv3 included in the | ||||
9 | * packaging of this file. Please review the following information to | ||||
10 | * ensure the GNU Lesser General Public License version 3 requirements | ||||
11 | * will be met: https://www.gnu.org/licenses/lgpl.html. | ||||
12 | * | ||||
13 | * GNU General Public License Usage | ||||
14 | * Alternatively, this file may be used under the terms of the GNU | ||||
15 | * General Public License version 2.0 or later as published by the Free | ||||
16 | * Software Foundation and appearing in the file LICENSE.GPL included in | ||||
17 | * the packaging of this file. Please review the following information to | ||||
18 | * ensure the GNU General Public License version 2.0 requirements will be | ||||
19 | * met: http://www.gnu.org/licenses/gpl-2.0.html. | ||||
20 | */ | ||||
21 | | ||||
22 | | ||||
23 | import QtQuick 2.6 | ||||
24 | import org.kde.kirigami 2.2 as Kirigami | ||||
25 | import QtQuick.Templates @QQC2_VERSION@ as T | ||||
26 | | ||||
27 | T.BusyIndicator { | ||||
28 | id: controlRoot | ||||
29 | | ||||
30 | implicitWidth: contentItem.implicitWidth + leftPadding + rightPadding | ||||
31 | implicitHeight: contentItem.implicitHeight + topPadding + bottomPadding | ||||
32 | | ||||
33 | padding: 6 | ||||
34 | spacing: Kirigami.Units.smallSpacing | ||||
35 | | ||||
36 | hoverEnabled: true | ||||
37 | | ||||
38 | contentItem: Kirigami.Icon { | ||||
39 | source: "view-refresh" | ||||
40 | opacity: controlRoot.running ? 1 : 0 | ||||
41 | | ||||
42 | // appearing/fading opacity change | ||||
43 | Behavior on opacity { | ||||
44 | OpacityAnimator { duration: 250 } | ||||
45 | } | ||||
46 | | ||||
47 | // rotating loading icon | ||||
48 | RotationAnimator { | ||||
49 | target: controlRoot | ||||
50 | running: controlRoot.visible && controlRoot.running | ||||
51 | from: 360 | ||||
52 | to: 0 | ||||
53 | loops: Animation.Infinite | ||||
54 | duration: 1000 | ||||
55 | } | ||||
56 | } | ||||
57 | } |