Fix desktop hover and emoji playback; share Android chat background
This commit is contained in:
1 parent
35648a19ce
commit
1e9264735b
13 files changed
+338
-51
No files matched your search
@@ -597,26 +597,7 @@ MessageList::MessageList(DbManager* db, AudioRecorder* recorder, QWidget *parent
|
||||
m_view->viewport()->update();
|
||||
});
|
||||
|
||||
connect(m_view, &ChatView::hoveredIndexChanged, this, [this](const QModelIndex &idx) {
|
||||
bool hasAnim = false;
|
||||
if (idx.isValid()) {
|
||||
QString text = idx.data(MsgTextRole).toString();
|
||||
for (auto it = g_animatedEmojiMap.begin(); it != g_animatedEmojiMap.end(); ++it) {
|
||||
if (text.contains(it.key())) { hasAnim = true; break; }
|
||||
}
|
||||
if (!hasAnim) {
|
||||
QVariantList reactions = idx.data(MsgReactionsRole).toList();
|
||||
for (const QVariant &rv : reactions) {
|
||||
if (g_animatedEmojiMap.contains(rv.toMap()["emoji"].toString()))
|
||||
{ hasAnim = true; break; }
|
||||
}
|
||||
}
|
||||
}
|
||||
bool wasActive = m_animHoverActive;
|
||||
m_animHoverActive = hasAnim;
|
||||
if (!wasActive && m_animHoverActive) AnimTimer::instance()->activate();
|
||||
else if (wasActive && !m_animHoverActive) AnimTimer::instance()->deactivate();
|
||||
});
|
||||
connect(m_view, &ChatView::animationTriggered, AnimTimer::instance(), &AnimTimer::play);
|
||||
|
||||
m_readDebounce = new QTimer(this);
|
||||
m_readDebounce->setSingleShot(true);
|
||||
|
||||
Reference in new issue
Block a user