mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-29 14:18:49 +03:00
Add workaround for TextEdit not rerendering after image loaded
fixes #541
This commit is contained in:
parent
47899ee7ed
commit
be0576f6a1
3 changed files with 19 additions and 0 deletions
|
@ -7,6 +7,7 @@ import QtQuick.Controls 2.3
|
||||||
import im.nheko 1.0
|
import im.nheko 1.0
|
||||||
|
|
||||||
TextEdit {
|
TextEdit {
|
||||||
|
id: r
|
||||||
textFormat: TextEdit.RichText
|
textFormat: TextEdit.RichText
|
||||||
readOnly: true
|
readOnly: true
|
||||||
focus: false
|
focus: false
|
||||||
|
@ -24,4 +25,8 @@ TextEdit {
|
||||||
cursorShape: hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
|
cursorShape: hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
TimelineManager.fixImageRendering(r.textDocument, r)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -681,3 +681,13 @@ TimelineViewManager::forwardMessageToRoom(mtx::events::collections::TimelineEven
|
||||||
},
|
},
|
||||||
*e);
|
*e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//! WORKAROUND(Nico): for https://bugreports.qt.io/browse/QTBUG-93281
|
||||||
|
void
|
||||||
|
TimelineViewManager::fixImageRendering(QQuickTextDocument *t, QQuickItem *i)
|
||||||
|
{
|
||||||
|
if (t) {
|
||||||
|
QObject::connect(
|
||||||
|
t->textDocument(), SIGNAL(imagesLoaded()), i, SLOT(updateWholeDocument()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
|
#include <QQuickItem>
|
||||||
|
#include <QQuickTextDocument>
|
||||||
#include <QQuickView>
|
#include <QQuickView>
|
||||||
#include <QQuickWidget>
|
#include <QQuickWidget>
|
||||||
#include <QSharedPointer>
|
#include <QSharedPointer>
|
||||||
|
@ -68,6 +70,8 @@ public:
|
||||||
Q_INVOKABLE void openLeaveRoomDialog(QString roomid) const;
|
Q_INVOKABLE void openLeaveRoomDialog(QString roomid) const;
|
||||||
Q_INVOKABLE void removeVerificationFlow(DeviceVerificationFlow *flow);
|
Q_INVOKABLE void removeVerificationFlow(DeviceVerificationFlow *flow);
|
||||||
|
|
||||||
|
Q_INVOKABLE void fixImageRendering(QQuickTextDocument *t, QQuickItem *i);
|
||||||
|
|
||||||
void verifyUser(QString userid);
|
void verifyUser(QString userid);
|
||||||
void verifyDevice(QString userid, QString deviceid);
|
void verifyDevice(QString userid, QString deviceid);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue