fix: waveform repaint via viewport()->update() instead of activeWindow()
- Timer now calls s_voiceView->viewport()->update() for correct delegate repaint - s_voiceView captured from option.widget in paint() voice section - Previously activeWindow()->update() didn't reach QListView viewport
This commit is contained in:
1 parent
05c7b4d47e
commit
e050f3f1f9
1 file changed
+3
-1
@@ -32,6 +32,7 @@ struct VoicePlayState {
|
||||
};
|
||||
static QMap<QString, VoicePlayState> s_voiceStates;
|
||||
static QTimer* s_voiceTimer = nullptr;
|
||||
static QAbstractItemView* s_voiceView = nullptr;
|
||||
|
||||
static void ensureVoiceTimer() {
|
||||
if (!s_voiceTimer) {
|
||||
@@ -56,7 +57,7 @@ static void ensureVoiceTimer() {
|
||||
}
|
||||
}
|
||||
if (!anyPlaying) s_voiceTimer->stop();
|
||||
if (auto* w = QApplication::activeWindow()) w->update();
|
||||
if (s_voiceView) s_voiceView->viewport()->update();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -603,6 +604,7 @@ void MessageDelegate::paint(QPainter *painter, const QStyleOptionViewItem &optio
|
||||
}
|
||||
|
||||
if (L.isVoice) {
|
||||
if (option.widget) s_voiceView = (QAbstractItemView*)option.widget;
|
||||
drawBubble(painter, L, option);
|
||||
if (!L.narrow) drawAvatar(painter, L, index);
|
||||
|
||||
|
||||
Reference in new issue
Block a user