summaryrefslogtreecommitdiffstats
path: root/examples/bluetooth/lowenergyscanner/Dialog.qml
blob: 75e82642a91d69a28c76d249fc3db6b99b08cc94 (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
// Copyright (C) 2013 BlackBerry Limited. All rights reserved.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

import QtQuick

Rectangle {
    id: dialog
    width: parent.width / 3 * 2
    height: dialogTextId.height + background.height + 20
    z: 50
    property string dialogText: ""
    property bool busyImage: true
    border.width: 1
    border.color: "#363636"
    radius: 10

    Text {
        id: dialogTextId
        horizontalAlignment: Text.AlignHCenter
        verticalAlignment: Text.AlignVCenter
        anchors.horizontalCenter: parent.horizontalCenter
        anchors.top: parent.top
        anchors.topMargin: 10

        elide: Text.ElideMiddle
        text: dialog.dialogText
        color: "#363636"
        wrapMode: Text.Wrap
    }

    Image {
        id: background

        width: 20
        height: 20
        anchors.top: dialogTextId.bottom
        anchors.horizontalCenter: dialogTextId.horizontalCenter
        visible: parent.busyImage
        source: "assets/busy_dark.png"
        fillMode: Image.PreserveAspectFit
        NumberAnimation on rotation {
            duration: 3000
            from: 0
            to: 360
            loops: Animation.Infinite
        }
    }
}