diff --git a/src/ui/MxcAnimatedImage.cpp b/src/ui/MxcAnimatedImage.cpp
index 14f5dbd8..ffe54c71 100644
--- a/src/ui/MxcAnimatedImage.cpp
+++ b/src/ui/MxcAnimatedImage.cpp
@@ -102,10 +102,12 @@ MxcAnimatedImage::startDownload()
if (buffer.bytesAvailable() <
4LL * 1024 * 1024 * 1024) // cache images smaller than 4MB in RAM
movie.setCacheMode(QMovie::CacheAll);
- if (play_)
+ if (play_ && movie.frameCount() > 1)
movie.start();
- else
+ else {
movie.jumpToFrame(0);
+ movie.setPaused(true);
+ }
emit loadedChanged();
update();
});
@@ -173,6 +175,9 @@ MxcAnimatedImage::updatePaintNode(QSGNode *oldNode, QQuickItem::UpdatePaintNodeD
if (!imageDirty)
return oldNode;
+ if (clipRect().isEmpty())
+ return oldNode;
+
imageDirty = false;
QSGImageNode *n = static_cast<QSGImageNode *>(oldNode);
if (!n) {
diff --git a/src/ui/MxcAnimatedImage.h b/src/ui/MxcAnimatedImage.h
index c9f89764..1f2c0b74 100644
--- a/src/ui/MxcAnimatedImage.h
+++ b/src/ui/MxcAnimatedImage.h
@@ -29,6 +29,7 @@ public:
connect(this, &MxcAnimatedImage::roomChanged, &MxcAnimatedImage::startDownload);
connect(&movie, &QMovie::frameChanged, this, &MxcAnimatedImage::newFrame);
setFlag(QQuickItem::ItemHasContents);
+ setFlag(QQuickItem::ItemObservesViewport);
// setAcceptHoverEvents(true);
}
@@ -55,7 +56,12 @@ public:
{
if (play_ != newPlay) {
play_ = newPlay;
- movie.setPaused(!play_);
+ if (movie.frameCount() > 1)
+ movie.setPaused(!play_);
+ else {
+ movie.jumpToFrame(0);
+ movie.setPaused(true);
+ }
emit playChanged();
}
}
@@ -77,7 +83,8 @@ private slots:
{
currentFrame = frame;
imageDirty = true;
- update();
+ if (!clipRect().isEmpty())
+ update();
}
private:
diff --git a/src/ui/NhekoDropArea.cpp b/src/ui/NhekoDropArea.cpp
index 63c9aa6f..348ef5d8 100644
--- a/src/ui/NhekoDropArea.cpp
+++ b/src/ui/NhekoDropArea.cpp
@@ -38,6 +38,7 @@ NhekoDropArea::dropEvent(QDropEvent *event)
auto model = ChatPage::instance()->timelineManager()->rooms()->getRoomById(roomid_);
if (model) {
model->input()->insertMimeData(event->mimeData());
+ ChatPage::instance()->timelineManager()->focusMessageInput();
}
}
}
diff --git a/src/ui/RoomSettings.cpp b/src/ui/RoomSettings.cpp
index 769f2c8d..5f4184b3 100644
--- a/src/ui/RoomSettings.cpp
+++ b/src/ui/RoomSettings.cpp
@@ -728,7 +728,7 @@ RoomSettingsAllowedRoomsModel::RoomSettingsAllowedRoomsModel(RoomSettings *paren
this->listedRoomIds = QStringList(parentSpaces.begin(), parentSpaces.end());
- for (const auto &e : qAsConst(this->allowedRoomIds)) {
+ for (const auto &e : std::as_const(this->allowedRoomIds)) {
if (!this->parentSpaces.count(e))
this->listedRoomIds.push_back(e);
}
|