Warning, /multimedia/kdenlive/src/monitor/view/Countdown.qml is written in an unsupported language. File is not indexed.
0001 /* 0002 SPDX-FileCopyrightText: 2022 Jean-Baptiste Mardelle <jb@kdenlive.org> 0003 SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0004 */ 0005 0006 import QtQuick.Controls 2.15 0007 import QtQuick 2.15 0008 0009 Rectangle { 0010 id: counter 0011 property int countdown: 3 0012 property int subcount: 0 0013 anchors.fill: parent 0014 property int size: Math.min(width, height) 0015 color: Qt.rgba(0, 0, 0, 0.5) 0016 Timer { 0017 id: countdownTimer 0018 interval: 100 0019 running: counter.countdown > 0 0020 repeat: true 0021 onTriggered: { 0022 counter.subcount += 1 0023 if (counter.subcount % 10 == 0) { 0024 counter.subcount = 0 0025 counter.countdown-- 0026 if (counter.countdown == 0) { 0027 root.stopCountdown() 0028 } 0029 } 0030 } 0031 } 0032 Rectangle { 0033 width: counter.size * 0.6 0034 height: width 0035 color: "black" 0036 border.color: "white" 0037 border.width: 4 0038 radius: width*0.5 0039 opacity: 0.5 0040 anchors.centerIn: parent 0041 } 0042 Repeater { 0043 model: 4 0044 anchors.fill: parent 0045 delegate: Label { 0046 anchors.centerIn: parent 0047 visible: counter.countdown <= index 0048 opacity: counter.countdown == index ? 1 : 0.4 0049 scale: counter.countdown >= index ? 1.0 : 0.0 0050 text: modelData 0051 color: index < 2 ? 'red' : 'white' 0052 font.pixelSize: counter.size * 0.5 0053 Behavior on opacity { NumberAnimation {} } 0054 //horizontalAlignment: Text.AlignHCenter 0055 } 0056 } 0057 Rectangle { 0058 color: 'white' 0059 height: 5 0060 anchors.bottom: parent.bottom 0061 anchors.bottomMargin: 10 0062 width: parent.width - (counter.subcount * parent.width / 10) 0063 } 0064 }