Add back busy indicator.

square-messages
Black Hat 2018-10-07 20:38:30 +08:00
parent c93efebd23
commit e69ac60d08
5 changed files with 20 additions and 12 deletions

View File

@ -31,7 +31,7 @@ Control {
layer.enabled: true
layer.effect: ElevationEffect {
elevation: 2
elevation: 1
}
}
}

View File

@ -66,4 +66,14 @@ Rectangle {
}
}
}
ProgressBar {
width: parent.width
z: 10
anchors.bottom: parent.bottom
Material.accent: "white"
visible: currentRoom && currentRoom.busy
indeterminate: true
}
}

View File

@ -65,14 +65,6 @@ Item {
id: roomHeader
}
ProgressBar {
Layout.fillWidth: true
z: 10
visible: currentRoom && currentRoom.busy
indeterminate: true
}
ListView {
Layout.fillWidth: true
Layout.fillHeight: true

View File

@ -8,8 +8,8 @@
#include "events/typingevent.h"
#include <QFileDialog>
#include <QMimeDatabase>
#include <QMetaObject>
#include <QMimeDatabase>
SpectralRoom::SpectralRoom(Connection* connection, QString roomId,
JoinState joinState)
@ -18,8 +18,7 @@ SpectralRoom::SpectralRoom(Connection* connection, QString roomId,
&SpectralRoom::countChanged);
connect(this, &SpectralRoom::highlightCountChanged, this,
&SpectralRoom::countChanged);
connect(this, &Room::addedMessages, this,
[=] { setBusy(false); });
connect(this, &Room::addedMessages, this, [=] { setBusy(false); });
}
void SpectralRoom::chooseAndUploadFile() {
@ -178,3 +177,8 @@ void SpectralRoom::saveViewport(int topIndex, int bottomIndex) {
setFirstDisplayedEvent(maxTimelineIndex() - topIndex);
setLastDisplayedEvent(maxTimelineIndex() - bottomIndex);
}
void SpectralRoom::getPreviousContent(int limit) {
setBusy(true);
Room::getPreviousContent(limit);
}

View File

@ -52,6 +52,8 @@ class SpectralRoom : public Room {
Q_INVOKABLE int savedBottomVisibleIndex() const;
Q_INVOKABLE void saveViewport(int topIndex, int bottomIndex);
Q_INVOKABLE void getPreviousContent(int limit = 10);
private:
QString m_cachedInput;
QSet<const QMatrixClient::RoomEvent*> highlights;