linphone-desktop/Linphone/view/Control/Display/ProgressBar.qml
Gaelle Braud 593863b4c2 update meeting list on day changed
fix text

fix #LINQT-1432 progress bar ui

try to fix #LINQT-1429 conference focus as active speaker
2024-12-04 08:39:00 +01:00

58 lines
1.5 KiB
QML

import QtQuick
import QtQuick.Controls.Basic
import Linphone
ProgressBar {
id: mainItem
padding: 3 * DefaultStyle.dp
property color backgroundColor: DefaultStyle.main2_100
property color innerColor: DefaultStyle.info_500_main
property color innerTextColor: centeredText ? DefaultStyle.info_500_main : DefaultStyle.grey_0
property bool innerTextVisible: true
property string innerText: Number.parseFloat(value*100).toFixed(0) + "%"
property int barWidth: mainItem.visualPosition * mainItem.width
property bool centeredText: textSize.width >= barWidth
TextMetrics{
id: textSize
text: mainItem.innerText
font {
pixelSize: 10 * DefaultStyle.dp
weight: 700 * DefaultStyle.dp
}
}
background: Rectangle {
color: mainItem.backgroundColor
radius: 50 * DefaultStyle.dp
anchors.fill: mainItem
width: mainItem.width
height: mainItem.height
}
contentItem: Item {
id: content
Rectangle {
id: bar
color: mainItem.innerColor
radius: 50 * DefaultStyle.dp
width: mainItem.barWidth
height: parent.height
}
Text {
visible: mainItem.innerTextVisible
text: mainItem.innerText
parent: mainItem.centeredText ? content : bar
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
color: mainItem.innerTextColor
maximumLineCount: 1
font {
pixelSize: 10 * DefaultStyle.dp
weight: 700 * DefaultStyle.dp
}
}
}
}