Add back busy indicator.

This commit is contained in:
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.enabled: true
layer.effect: ElevationEffect { 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 id: roomHeader
} }
ProgressBar {
Layout.fillWidth: true
z: 10
visible: currentRoom && currentRoom.busy
indeterminate: true
}
ListView { ListView {
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true

View File

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