ProgressBar.qml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. // Copyright (C) 2017 The Qt Company Ltd.
  2. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
  3. // Qt-Security score:significant reason:default
  4. import QtQuick
  5. import QtQuick.Templates as T
  6. import QtQuick.Controls.Material
  7. import QtQuick.Controls.Material.impl
  8. T.ProgressBar {
  9. id: control
  10. implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
  11. implicitContentWidth + leftPadding + rightPadding)
  12. implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
  13. implicitContentHeight + topPadding + bottomPadding)
  14. contentItem: ProgressBarImpl {
  15. implicitHeight: 4
  16. scale: control.mirrored ? -1 : 1
  17. color: control.Material.accentColor
  18. progress: control.position
  19. indeterminate: control.visible && control.indeterminate
  20. }
  21. background: Rectangle {
  22. implicitWidth: 200
  23. implicitHeight: 4
  24. y: (control.height - height) / 2
  25. height: 4
  26. color: Qt.rgba(control.Material.accentColor.r, control.Material.accentColor.g, control.Material.accentColor.b, 0.25)
  27. }
  28. }