1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

fix(UI): update peer label's style after setting audio playing property

This commit is contained in:
Anthony Bilinski 2019-01-29 09:13:15 -08:00
parent 7f802f593e
commit 477950737f
No known key found for this signature in database
GPG Key ID: 2AA8E0DA1B31FB3C

View File

@ -365,6 +365,8 @@ void GroupChatForm::sendJoinLeaveMessages()
void GroupChatForm::peerAudioPlaying(ToxPk peerPk)
{
peerLabels[peerPk]->setProperty("playingAudio", LABEL_PEER_PLAYING_AUDIO);
peerLabels[peerPk]->style()->unpolish(peerLabels[peerPk]);
peerLabels[peerPk]->style()->polish(peerLabels[peerPk]);
// TODO(sudden6): check if this can ever be false, cause [] default constructs
if (!peerAudioTimers[peerPk]) {
peerAudioTimers[peerPk] = new QTimer(this);
@ -376,6 +378,8 @@ void GroupChatForm::peerAudioPlaying(ToxPk peerPk)
auto it = peerLabels.find(peerPk);
if (it != peerLabels.end()) {
peerLabels[peerPk]->setProperty("playingAudio", LABEL_PEER_NOT_PLAYING_AUDIO);
peerLabels[peerPk]->style()->unpolish(peerLabels[peerPk]);
peerLabels[peerPk]->style()->polish(peerLabels[peerPk]);
}
delete peerAudioTimers[peerPk];
peerAudioTimers[peerPk] = nullptr;