Skip to content
Permalink
Browse files

explicit download/game instruction

  • Loading branch information...
illwieckz committed Aug 20, 2019
1 parent b529933 commit 9df8809f37b576f56c673d611eff90b0ea5efbe1
Showing with 51 additions and 1 deletion.
  1. +51 −1 DownloadInfo.qml
@@ -12,16 +12,33 @@ Item {
anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottomMargin: 60

Card {
width: parent.width - downloadAction.width
height: parent.height
Material.elevation: 2
Material.theme: Material.Dark
Material.background: "black"

Item {
width: parent.width
height: parent.height

BodyLabel {
id: instruction

anchors {
top: parent.top
left: parent.left
leftMargin: 7
topMargin: 9
}

visible: true
font.pixelSize: 22
text: "Press button to download the game"
}

ProgressBar {
anchors.top: parent.top
width: parent.width
@@ -31,61 +48,88 @@ Item {
value: downloader.completedSize / downloader.totalSize
Material.accent: Material.Teal
}

Row {
id: downloadInfo
anchors.bottom: parent.bottom

anchors {
bottom: parent.bottom
margins: 7
}

visible: false

BodyLabel {
width: 5
}

BodyLabel {
id: completedDownload
text: Utils.humanSize(downloader.completedSize)
font.pixelSize: 17
}

BodyLabel {
text: " / "
font.pixelSize: 17
}

BodyLabel {
id: totalDownload
text: Utils.humanSize(downloader.totalSize)
font.pixelSize: 17
}

BodyLabel {
width: 20
}

BodyLabel {
id: eta
text: Utils.humanTime(downloader.eta)
font.pixelSize: 17
}

BodyLabel {
width: 20
}

BodyLabel {
text: "DL: "
font.pixelSize: 17
}

BodyLabel {
id: downloadSpeed
text: Utils.humanSize(downloader.downloadSpeed)
font.pixelSize: 17
}

BodyLabel {
width: 20
text: "/s"
font.pixelSize: 17
}

BodyLabel {
text: "UL: "
font.pixelSize: 17
}

BodyLabel {
id: uploadSpeed
text: Utils.humanSize(downloader.uploadSpeed)
font.pixelSize: 17
}

BodyLabel {
text: "/s"
font.pixelSize: 17
}
}
}
}

ActionButton {
id: downloadAction
iconName: "file/file_download"
@@ -103,17 +147,23 @@ Item {
downloader.toggleDownload();
}
}

Connections {
target: downloader
ignoreUnknownSignals: true

onStateChanged: {
downloadInfo.visible = state !== QmlDownloader.COMPLETED;
if (state === QmlDownloader.DOWNLOADING) {
downloadAction.iconName = "av/pause";
instruction.visible = false;
} else if (state === QmlDownloader.PAUSED) {
downloadAction.iconName = "file/file_download";
instruction.visible = false;
} else if (state === QmlDownloader.COMPLETED) {
downloadAction.iconName = "av/play_arrow";
instruction.visible = true;
instruction.text = "Press button to play the game";
}
}
}

0 comments on commit 9df8809

Please sign in to comment.
You can’t perform that action at this time.