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

Merge pull request #137 from F1ynn/Misc-GUI-stuff

Fix status on F1ynn's theme, notify on non-active window (like uTox)
This commit is contained in:
Tux3 / Mlkj / !Lev.uXFMLA 2014-07-14 14:45:55 +02:00
commit 8599fb4a5a

View File

@ -575,7 +575,7 @@ void Widget::onFriendMessageReceived(int friendId, const QString& message)
if (activeFriendWidget != nullptr)
{
Friend* f2 = FriendList::findFriend(activeFriendWidget->friendId);
if (((f->friendId != f2->friendId) || isFriendWidgetActive == 0) || isWindowMinimized)
if (((f->friendId != f2->friendId) || isFriendWidgetActive == 0) || isWindowMinimized || !isActiveWindow())
{
f->hasNewMessages = 1;
newMessageAlert();
@ -667,7 +667,7 @@ void Widget::onGroupMessageReceived(int groupnumber, int friendgroupnumber, cons
g->chatForm->addGroupMessage(message, friendgroupnumber);
if ((isGroupWidgetActive != 1 || (g->groupId != activeGroupWidget->groupId)) || isWindowMinimized)
if ((isGroupWidgetActive != 1 || (g->groupId != activeGroupWidget->groupId)) || isWindowMinimized || !isActiveWindow())
{
if (message.contains(core->getUsername(), Qt::CaseInsensitive))
{
@ -769,8 +769,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"));
if (!useNativeTheme)
newgroup->widget->statusPic.setPixmap(QPixmap(":img/status/dot_groupchat.png"));
updateFriendListWidth();
connect(newgroup->widget, SIGNAL(groupWidgetClicked(GroupWidget*)), this, SLOT(onGroupWidgetClicked(GroupWidget*)));
connect(newgroup->widget, SIGNAL(removeGroup(int)), this, SLOT(removeGroup(int)));