Warning, /maui/mauikit/src/style.5/ProgressBar.qml is written in an unsupported language. File is not indexed.

0001 /*
0002  * Copyright 2017 Marco Martin <mart@kde.org>
0003  * Copyright 2017 The Qt Company Ltd.
0004  *
0005  * GNU Lesser General Public License Usage
0006  * Alternatively, this file may be used under the terms of the GNU Lesser
0007  * General Public License version 3 as published by the Free Software
0008  * Foundation and appearing in the file LICENSE.LGPLv3 included in the
0009  * packaging of this file. Please review the following information to
0010  * ensure the GNU Lesser General Public License version 3 requirements
0011  * will be met: https://www.gnu.org/licenses/lgpl.html.
0012  *
0013  * GNU General Public License Usage
0014  * Alternatively, this file may be used under the terms of the GNU
0015  * General Public License version 2.0 or later as published by the Free
0016  * Software Foundation and appearing in the file LICENSE.GPL included in
0017  * the packaging of this file. Please review the following information to
0018  * ensure the GNU General Public License version 2.0 requirements will be
0019  * met: http://www.gnu.org/licenses/gpl-2.0.html.
0020  */
0021 
0022 
0023 import QtQuick 2.15
0024 import QtQuick.Templates 2.14 as T
0025 
0026 import org.mauikit.controls 1.3 as Maui
0027 
0028 import QtGraphicalEffects 1.0
0029 
0030 T.ProgressBar
0031 {
0032     id: control
0033     
0034     Maui.Theme.colorSet: Maui.Theme.Button
0035     Maui.Theme.inherit: false
0036     
0037     implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
0038                             implicitContentWidth + leftPadding + rightPadding)
0039     implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
0040                              implicitContentHeight + topPadding + bottomPadding)    
0041     
0042     property int radius: Maui.Style.radiusV
0043     
0044     contentItem: Item 
0045     {
0046         id: _item
0047         implicitHeight: 10
0048         
0049         scale: control.mirrored ? -1 : 1
0050         
0051         Rectangle 
0052         {
0053             visible: !control.indeterminate
0054             height: parent.height
0055             width: control.position * parent.width
0056             
0057             radius: control.radius
0058             color: Maui.Theme.highlightColor            
0059         }
0060         
0061         Repeater
0062         {
0063             model: 2
0064             enabled: !control.indeterminate
0065             
0066             Rectangle 
0067             {
0068                 property real offset: 0
0069                 
0070                 x:  offset * parent.width
0071               
0072                 width: offset * (parent.width - x)
0073                 height: parent.height
0074                 
0075                 radius: control.radius                
0076                 color: Maui.Theme.highlightColor
0077                 
0078                 Behavior on color
0079                 {
0080                     Maui.ColorTransition{}
0081                 }
0082                 
0083                 SequentialAnimation on offset
0084                 {
0085                     loops: Animation.Infinite
0086                     running: control.indeterminate && control.visible
0087                     PauseAnimation { duration: index ? 520 : 0 }
0088                     NumberAnimation
0089                     {
0090                         easing.type: Easing.OutCubic
0091                         duration: 1240
0092                         from: 0
0093                         to: 1
0094                     }
0095                     PauseAnimation { duration: index ? 0 : 520 }
0096                 }
0097             }
0098         }
0099         
0100         layer.enabled: control.radius > 0
0101         layer.effect: OpacityMask
0102         {
0103             maskSource: Rectangle
0104             {
0105                 width: _item.width
0106                 height: _item.height
0107                 radius: control.radius
0108             }
0109         }
0110     }
0111 
0112     background: Rectangle 
0113     {
0114         radius: control.radius
0115         color: Maui.Theme.backgroundColor
0116         Behavior on color
0117         {
0118             Maui.ColorTransition{}
0119         }      
0120             }
0121         
0122     
0123 }
0124