1414 property alias value: progressBar .value
1515 property alias usedText: usedLabel .text
1616 property alias totalText: totalLabel .text
17- property alias upgradeUrl : upgradeLink .url
17+ property alias relatedUrl : linkItem .url
1818
1919 property color normalColor: Theme .qfieldcloudBlue
2020 property color warningColor: Theme .warningColor
@@ -33,19 +33,25 @@ Item {
3333 spacing: 8
3434
3535 Item {
36- id: upgradeLink
36+ id: linkItem
3737 Layout .fillWidth : true
38- implicitHeight: upgradeLinkRow .implicitHeight
38+ implicitHeight: linkRow .implicitHeight
3939
4040 property string url: " "
4141 property bool isCritical: value >= meterBar .criticalThreshold
42+ property bool hasUrl: url !== " "
4243
4344 Row {
44- id: upgradeLinkRow
45+ id: linkRow
4546 spacing: 8
4647
4748 Label {
48- text: upgradeLink .isCritical ? qsTr (" Tap to upgrade" ) : qsTr (" Tap to manage" )
49+ text: {
50+ if (! linkItem .hasUrl ) {
51+ return qsTr (" Storage" );
52+ }
53+ return linkItem .isCritical ? qsTr (" Tap to upgrade storage" ) : qsTr (" Tap to manage storage" );
54+ }
4955 font: Theme .tipFont
5056 color: Theme .mainTextColor
5157 anchors .verticalCenter : parent .verticalCenter
5561 width: 10
5662 height: 10
5763 anchors .verticalCenter : parent .verticalCenter
64+ visible: linkItem .hasUrl
5865
5966 ShapePath {
6067 strokeWidth: 1.5
@@ -161,7 +168,11 @@ Item {
161168
162169 MouseArea {
163170 anchors .fill : parent
164- cursorShape: Qt .PointingHandCursor
165- onClicked: Qt .openUrlExternally (upgradeLink .url )
171+ cursorShape: linkItem .hasUrl ? Qt .PointingHandCursor : Qt .ArrowCursor
172+ onClicked: {
173+ if (linkItem .hasUrl ) {
174+ Qt .openUrlExternally (linkItem .url );
175+ }
176+ }
166177 }
167178}
0 commit comments