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:
parent
7f802f593e
commit
477950737f
|
@ -365,6 +365,8 @@ void GroupChatForm::sendJoinLeaveMessages()
|
||||||
void GroupChatForm::peerAudioPlaying(ToxPk peerPk)
|
void GroupChatForm::peerAudioPlaying(ToxPk peerPk)
|
||||||
{
|
{
|
||||||
peerLabels[peerPk]->setProperty("playingAudio", LABEL_PEER_PLAYING_AUDIO);
|
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
|
// TODO(sudden6): check if this can ever be false, cause [] default constructs
|
||||||
if (!peerAudioTimers[peerPk]) {
|
if (!peerAudioTimers[peerPk]) {
|
||||||
peerAudioTimers[peerPk] = new QTimer(this);
|
peerAudioTimers[peerPk] = new QTimer(this);
|
||||||
|
@ -376,6 +378,8 @@ void GroupChatForm::peerAudioPlaying(ToxPk peerPk)
|
||||||
auto it = peerLabels.find(peerPk);
|
auto it = peerLabels.find(peerPk);
|
||||||
if (it != peerLabels.end()) {
|
if (it != peerLabels.end()) {
|
||||||
peerLabels[peerPk]->setProperty("playingAudio", LABEL_PEER_NOT_PLAYING_AUDIO);
|
peerLabels[peerPk]->setProperty("playingAudio", LABEL_PEER_NOT_PLAYING_AUDIO);
|
||||||
|
peerLabels[peerPk]->style()->unpolish(peerLabels[peerPk]);
|
||||||
|
peerLabels[peerPk]->style()->polish(peerLabels[peerPk]);
|
||||||
}
|
}
|
||||||
delete peerAudioTimers[peerPk];
|
delete peerAudioTimers[peerPk];
|
||||||
peerAudioTimers[peerPk] = nullptr;
|
peerAudioTimers[peerPk] = nullptr;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user