Warning, /plasma/discover/discover/qml/LabelBackground.qml is written in an unsupported language. File is not indexed.

0001 /*
0002  *   SPDX-FileCopyrightText: 2012 Aleix Pol Gonzalez <aleixpol@blue-systems.com>
0003  *
0004  *   SPDX-License-Identifier: LGPL-2.0-or-later
0005  */
0006 
0007 import QtQuick 2.1
0008 import QtQuick.Controls 2.1
0009 import QtQuick.Layouts 1.1
0010 import org.kde.discover.app 1.0
0011 import org.kde.kirigami 2.14 as Kirigami
0012 
0013 Control
0014 {
0015     id: root
0016     property alias text: theLabel.text
0017     property real progress: 1.0
0018     readonly property bool inProgress: progress > 0
0019     padding: Kirigami.Units.smallSpacing * 1.5
0020 
0021     background: Item {
0022         visible: root.inProgress
0023         Rectangle {
0024             color: Kirigami.Theme.disabledTextColor
0025             border.width: 1
0026             border.color: Qt.darker(Kirigami.Theme.disabledTextColor)
0027             anchors.fill: parent
0028             radius: root.padding
0029         }
0030 
0031         Rectangle {
0032             anchors {
0033                 fill: parent
0034                 leftMargin: 1
0035                 rightMargin: ((1-root.progress) * parent.width) + 1
0036                 topMargin: 1
0037                 bottomMargin: 1
0038             }
0039             color: Kirigami.Theme.highlightColor
0040             radius: root.padding-2
0041         }
0042     }
0043 
0044     contentItem: Label {
0045         id: theLabel
0046         horizontalAlignment: Text.AlignHCenter
0047         color: root.inProgress ? Kirigami.Theme.highlightedTextColor : Kirigami.Theme.textColor
0048     }
0049 }