diff --git a/Linphone/view/Control/Display/ProgressBar.qml b/Linphone/view/Control/Display/ProgressBar.qml index 9b2f216a1..8ac977904 100644 --- a/Linphone/view/Control/Display/ProgressBar.qml +++ b/Linphone/view/Control/Display/ProgressBar.qml @@ -9,9 +9,17 @@ ProgressBar { property color backgroundColor: DefaultStyle.main2_100 property color innerColor: DefaultStyle.info_500_main - property color innerTextColor: DefaultStyle.grey_0 + 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 + } background: Rectangle { color: mainItem.backgroundColor @@ -22,19 +30,20 @@ ProgressBar { } contentItem: Item { Rectangle { + id: bar color: mainItem.innerColor radius: 50 * DefaultStyle.dp - width: mainItem.visualPosition * mainItem.width + width: mainItem.barWidth height: parent.height - Text { - visible: innerTextVisible && mainItem.value > 0 - text: mainItem.innerText - anchors.centerIn: parent - color: mainItem.innerTextColor - font { - pixelSize: 10 * DefaultStyle.dp - weight: 700 * DefaultStyle.dp - } + } + Text { + visible: mainItem.innerTextVisible + text: mainItem.innerText + anchors.centerIn: mainItem.centeredText ? parent : bar + color: mainItem.innerTextColor + font { + pixelSize: 10 * DefaultStyle.dp + weight: 700 * DefaultStyle.dp } } } diff --git a/Linphone/view/Page/Main/Contact/ContactPage.qml b/Linphone/view/Page/Main/Contact/ContactPage.qml index 555526c8d..6f6b13cb4 100644 --- a/Linphone/view/Page/Main/Contact/ContactPage.qml +++ b/Linphone/view/Page/Main/Contact/ContactPage.qml @@ -591,6 +591,7 @@ AbstractMainPage { } RoundedPane { Layout.preferredWidth: 360 * DefaultStyle.dp + bottomPadding: 21 * DefaultStyle.dp contentItem: ColumnLayout { spacing: 13 * DefaultStyle.dp Text { @@ -637,9 +638,12 @@ AbstractMainPage { } Button { + Layout.preferredHeight: 30 * DefaultStyle.dp visible: modelData.securityLevel != LinphoneEnums.SecurityLevel.EndToEndEncryptedAndVerified color: DefaultStyle.main1_100 icon.source: AppIcons.warningCircle + icon.height: 14 * DefaultStyle.dp + icon.width: 14 * DefaultStyle.dp contentImageColor: DefaultStyle.main1_500_main textColor: DefaultStyle.main1_500_main textSize: 13 * DefaultStyle.dp