Skip to content

Commit ddb8f00

Browse files
committed
Add refresh button for reloading data cache.
1 parent 85a2041 commit ddb8f00

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

source/Page1.qml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -143,23 +143,24 @@ Item {
143143
anchors.rightMargin: 15
144144
visible: application.progress === 1
145145
Label {
146-
text: "Version: " + application.version + " (Data Version: "
146+
id: versionLabel
147+
text: "Version: " + application.version + " (Data Version: " + application.dataVersion
147148
rightPadding: 0
148149
leftPadding: 0
149150
verticalAlignment: Text.AlignVCenter
150151
horizontalAlignment: Text.AlignRight
151152
}
152-
Label {
153-
text: application.dataVersion
153+
Button {
154154
rightPadding: 0
155155
leftPadding: 0
156-
verticalAlignment: Text.AlignVCenter
157-
horizontalAlignment: Text.AlignRight
158-
font.underline: true
159-
MouseArea {
160-
anchors.fill: parent
161-
onDoubleClicked: application.resetData()
162-
}
156+
width: versionLabel.height
157+
height: versionLabel.height
158+
icon.source: "qrc:/refresh.png"
159+
icon.color: "transparent"
160+
flat: true
161+
onDoubleClicked: application.resetData()
162+
ToolTip.visible: down
163+
ToolTip.text: "Double click to force reloading data from the internet"
163164
}
164165
Label {
165166
text: ")"

source/Resources.qrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
<RCC version="1.0">
33
<qresource>
44
<file>icon.ico</file>
5+
<file>refresh.png</file>
56
</qresource>
67
</RCC>

source/refresh.png

3.63 KB
Loading

0 commit comments

Comments
 (0)