Add progress indicator && change a minor issue.
This commit is contained in:
parent
87e7bf8795
commit
e79b2c22ed
|
@ -1,13 +1,19 @@
|
||||||
import QtQuick 2.9
|
import QtQuick 2.9
|
||||||
import QtQuick.Controls 2.2
|
import QtQuick.Controls 2.2
|
||||||
|
import QtQuick.Controls.Material 2.2
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
width: parent.width
|
|
||||||
height: visible ? childrenRect.height : 0
|
|
||||||
|
|
||||||
property bool openOnFinished: false
|
property bool openOnFinished: false
|
||||||
readonly property bool downloaded: progressInfo && progressInfo.completed
|
readonly property bool downloaded: progressInfo && progressInfo.completed
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
z: 5
|
||||||
|
height: parent.height
|
||||||
|
width: progressInfo.active && !progressInfo.completed ? progressInfo.progress / progressInfo.total * parent.width : 0
|
||||||
|
color: Material.accent
|
||||||
|
opacity: 0.4
|
||||||
|
}
|
||||||
|
|
||||||
onDownloadedChanged: {
|
onDownloadedChanged: {
|
||||||
if (downloaded && openOnFinished)
|
if (downloaded && openOnFinished)
|
||||||
openSavedFile()
|
openSavedFile()
|
||||||
|
|
|
@ -52,7 +52,7 @@ void RoomListModel::connectRoomSignals(QMatrixClient::Room* room) {
|
||||||
connect(room, &QMatrixClient::Room::joinStateChanged, this,
|
connect(room, &QMatrixClient::Room::joinStateChanged, this,
|
||||||
[=] { refresh(room); });
|
[=] { refresh(room); });
|
||||||
connect(room, &QMatrixClient::Room::avatarChanged, this,
|
connect(room, &QMatrixClient::Room::avatarChanged, this,
|
||||||
[=] { refresh(room, {Qt::DecorationRole}); });
|
[=] { refresh(room, {AvatarRole}); });
|
||||||
}
|
}
|
||||||
|
|
||||||
void RoomListModel::updateRoom(QMatrixClient::Room* room,
|
void RoomListModel::updateRoom(QMatrixClient::Room* room,
|
||||||
|
|
Loading…
Reference in New Issue