Welcome to mirror list, hosted at ThFree Co, Russian Federation.

NCBusyIndicator.qml « tray « gui « src - github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c489e5f3918277df8971d763e9f9f7ab5918ac13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
 * Copyright (C) 2022 by Claudio Cambra <claudio.cambra@nextcloud.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
 * for more details.
 */

import QtQuick 2.15
import QtQuick.Controls 2.15
import Style 1.0

BusyIndicator {
    id: root

    property color color: Style.ncSecondaryTextColor
    property string imageSource: "image://svgimage-custom-color/change.svg/"

    contentItem: Image {
        id: contentImage

        property bool colourableImage: root.color && root.imageSource.startsWith("image://svgimage-custom-color/")

        horizontalAlignment: Image.AlignHCenter
        verticalAlignment: Image.AlignVCenter

        source: colourableImage ? root.imageSource + root.color : root.imageSource
        sourceSize.width: 64
        sourceSize.height: 64
        fillMode: Image.PreserveAspectFit

        mipmap: true

        RotationAnimator {
            target: contentImage
            running: root.running
            onRunningChanged: contentImage.rotation = 0
            from: 0
            to: 360
            loops: Animation.Infinite
            duration: 3000
        }
    }
}