2 * Copyright (C) 2016 The Qt Company Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 import QtQuick.Templates 2.0 as T
19 import QtGraphicalEffects 1.0
23 implicitWidth: background.implicitWidth
24 implicitHeight: background.implicitHeight
26 background: Rectangle {
29 radius: control.height / 2
30 x: control.leftPadding
31 y: parent.height / 2 - height / 2
36 implicitWidth: background.implicitWidth
37 implicitHeight: background.implicitHeight
40 width: control.visualPosition * background.width
41 height: background.height
42 radius: background.radius
43 visible: !control.indeterminate
47 visible: control.indeterminate
48 width: background.width * 0.1
49 height: background.height
50 radius: background.radius
51 NumberAnimation on x {
53 to: background.width * 0.9
55 loops: Animation.Infinite
56 running: control.indeterminate
57 easing.type: Easing.SineCurve
62 layer.effect: LinearGradient {
64 end: Qt.point(background.width, 0)
66 GradientStop { position: 0.0; color: "#00ADDC" }
67 GradientStop { position: 1.0; color: "#6BFBFF" }