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

Fixed segfault when removing friend, minor UI changes

This commit is contained in:
Kevin Flynn 2014-06-27 07:16:38 -07:00
parent ca00383efa
commit 5262096b04
4 changed files with 11 additions and 2 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 549 B

View File

@ -40,6 +40,8 @@ void AddFriendForm::onSendTriggered()
QString id = toxId.text(), msg = message.toPlainText();
if (id.isEmpty())
return;
if (message.isEmpty())
msg = "Tox me maybe?";
emit friendRequested(id, msg);
}

View File

@ -76,6 +76,7 @@ void FriendWidget::setAsActiveChatroom()
QPalette pal3;
pal3.setColor(QPalette::Background, Qt::white);
this->setPalette(pal3);
avatar.setPixmap(QPixmap("img/contact list icons/contact_dark.png"));
}
void FriendWidget::setAsInactiveChatroom()
@ -92,4 +93,5 @@ void FriendWidget::setAsInactiveChatroom()
QPalette pal3;
pal3.setColor(QPalette::Background, QColor(63,63,63,255));
this->setPalette(pal3);
avatar.setPixmap(QPixmap("img/contact list icons/contact.png"));
}

View File

@ -173,13 +173,18 @@ void Widget::hideMainForms()
item->widget()->hide();
while ((item = ui->mainContent->layout()->takeAt(0)) != 0)
item->widget()->hide();
if (activeFriendWidget != nullptr)
{
activeFriendWidget->setAsInactiveChatroom();
Friend* f = FriendList::findFriend(activeFriendWidget->friendId);
if (f != nullptr)
activeFriendWidget->setAsInactiveChatroom();
}
if (activeGroupWidget != nullptr)
{
activeGroupWidget->setAsInactiveChatroom();
Group* g = GroupList::findGroup(activeGroupWidget->groupId);
if (g != nullptr)
activeGroupWidget->setAsInactiveChatroom();
}
}