More progress bars & fix some web page previews
This commit is contained in:
parent
fa470f73ba
commit
6666cf494a
4 changed files with 59 additions and 30 deletions
|
@ -101,6 +101,10 @@ Item {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (fileId === audioFileId) {
|
||||
downloadingProgressBar.maximumValue = fileInformation.size;
|
||||
downloadingProgressBar.value = fileInformation.local.downloaded_size;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -128,11 +132,16 @@ Item {
|
|||
visible: playButton.visible
|
||||
}
|
||||
|
||||
Row {
|
||||
Column {
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
height: downloadingProgressBar.height + audioControlRow.height
|
||||
anchors.centerIn: parent
|
||||
Row {
|
||||
id: audioControlRow
|
||||
width: parent.width
|
||||
height: Theme.iconSizeLarge
|
||||
Item {
|
||||
height: parent.height
|
||||
height: Theme.iconSizeLarge
|
||||
width: parent.width
|
||||
Image {
|
||||
id: playButton
|
||||
|
@ -158,6 +167,16 @@ Item {
|
|||
}
|
||||
}
|
||||
}
|
||||
ProgressBar {
|
||||
id: downloadingProgressBar
|
||||
minimumValue: 0
|
||||
maximumValue: 100
|
||||
value: 0
|
||||
visible: audioDownloadBusyIndicator.visible
|
||||
width: parent.width
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Rectangle {
|
||||
id: audioErrorShade
|
||||
|
|
|
@ -52,7 +52,7 @@ Item {
|
|||
onFileUpdated: {
|
||||
if (documentData) {
|
||||
if (!fileInformation.remote.is_uploading_active && fileId === documentData.document.id && fileInformation.local.is_downloading_completed) {
|
||||
downloadBusyIndicator.running = false;
|
||||
downloadingProgressBar.visible = false;
|
||||
documentData.document = fileInformation;
|
||||
downloadDocumentButton.visible = false;
|
||||
openDocumentButton.visible = true;
|
||||
|
@ -61,6 +61,10 @@ Item {
|
|||
tdLibWrapper.openFileOnDevice(documentData.document.local.path);
|
||||
}
|
||||
}
|
||||
if (fileId === documentData.document.id) {
|
||||
downloadingProgressBar.maximumValue = fileInformation.size;
|
||||
downloadingProgressBar.value = fileInformation.local.downloaded_size;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -73,16 +77,18 @@ Item {
|
|||
visible: false
|
||||
onClicked: {
|
||||
downloadDocumentButton.visible = false;
|
||||
downloadBusyIndicator.running = true;
|
||||
downloadingProgressBar.visible = true;
|
||||
tdLibWrapper.downloadFile(documentData.document.id);
|
||||
}
|
||||
}
|
||||
|
||||
BusyIndicator {
|
||||
id: downloadBusyIndicator
|
||||
running: false
|
||||
size: BusyIndicatorSize.Medium
|
||||
visible: running
|
||||
ProgressBar {
|
||||
id: downloadingProgressBar
|
||||
minimumValue: 0
|
||||
maximumValue: 100
|
||||
value: 0
|
||||
visible: false
|
||||
width: parent.width
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
|
||||
|
|
|
@ -362,6 +362,10 @@ ListItem {
|
|||
WebPagePreview {
|
||||
id: webPagePreview
|
||||
|
||||
Component.onCompleted: {
|
||||
webPagePreviewLoader.height = 0;
|
||||
}
|
||||
|
||||
onImplicitHeightChanged: {
|
||||
webPagePreviewLoader.height = webPagePreview.implicitHeight;
|
||||
}
|
||||
|
|
|
@ -608,7 +608,7 @@ Page {
|
|||
case "LocationPreview":
|
||||
return parentWidth * 0.66666666; // 2 / 3;
|
||||
case "VideoPreview":
|
||||
return ( content['@type'] === "messageVideoNote" ) ? content.video_note.length : ( Functions.getVideoHeight(parentWidth, ( content['@type'] === "messageVideo" ) ? content.video : content.animation) );
|
||||
return ( content['@type'] === "messageVideoNote" ) ? parentWidth : ( Functions.getVideoHeight(parentWidth, ( content['@type'] === "messageVideo" ) ? content.video : content.animation) );
|
||||
case "AudioPreview":
|
||||
return parentWidth / 2;
|
||||
case "DocumentPreview":
|
||||
|
|
Loading…
Reference in a new issue