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

Merge pull request #109 from F1ynn/fix-104

Fix #104
This commit is contained in:
Tux3 / Mlkj / !Lev.uXFMLA 2014-07-06 19:46:05 +02:00
commit af4706a892

View File

@ -661,13 +661,19 @@ void Widget::onGroupMessageReceived(int groupnumber, int friendgroupnumber, cons
newMessageAlert();
g->hasNewMessages = 1;
g->userWasMentioned = 1;
g->widget->statusPic.setPixmap(QPixmap(":img/status/dot_groupchat_notification.png"));
if (useNativeTheme)
g->widget->statusPic.setPixmap(QPixmap(":img/status/dot_online_notification.png"));
else
g->widget->statusPic.setPixmap(QPixmap(":img/status/dot_groupchat_notification.png"));
}
else
if (g->hasNewMessages == 0)
{
g->hasNewMessages = 1;
g->widget->statusPic.setPixmap(QPixmap(":img/status/dot_groupchat_newmessages.png"));
if (useNativeTheme)
g->widget->statusPic.setPixmap(QPixmap(":img/status/dot_online_notification.png"));
else
g->widget->statusPic.setPixmap(QPixmap(":img/status/dot_groupchat_newmessages.png"));
}
}
}
@ -711,7 +717,10 @@ void Widget::onGroupWidgetClicked(GroupWidget* widget)
{
g->hasNewMessages = 0;
g->userWasMentioned = 0;
g->widget->statusPic.setPixmap(QPixmap(":img/status/dot_groupchat.png"));
if (useNativeTheme)
g->widget->statusPic.setPixmap(QPixmap(":img/status/dot_online.png"));
else
g->widget->statusPic.setPixmap(QPixmap(":img/status/dot_groupchat.png"));
}
}
@ -747,6 +756,8 @@ Group *Widget::createGroup(int groupId)
QWidget* widget = ui->friendList->widget();
QLayout* layout = widget->layout();
layout->addWidget(newgroup->widget);
if (useNativeTheme)
newgroup->widget->statusPic.setPixmap(QPixmap(":img/status/dot_online.png"));
updateFriendListWidth();
connect(newgroup->widget, SIGNAL(groupWidgetClicked(GroupWidget*)), this, SLOT(onGroupWidgetClicked(GroupWidget*)));
connect(newgroup->widget, SIGNAL(removeGroup(int)), this, SLOT(removeGroup(int)));
@ -814,7 +825,10 @@ bool Widget::event(QEvent * e)
Group* g = GroupList::findGroup(activeGroupWidget->groupId);
g->hasNewMessages = 0;
g->userWasMentioned = 0;
g->widget->statusPic.setPixmap(QPixmap(":img/status/dot_groupchat.png"));
if (useNativeTheme)
g->widget->statusPic.setPixmap(QPixmap(":img/status/dot_online.png"));
else
g->widget->statusPic.setPixmap(QPixmap(":img/status/dot_groupchat.png"));
}
}
else if (e->type() == QEvent::WindowDeactivate && !useNativeTheme)