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:
parent
ca00383efa
commit
5262096b04
BIN
img/contact list icons/contact_dark.png
Normal file
BIN
img/contact list icons/contact_dark.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 549 B |
|
@ -40,6 +40,8 @@ void AddFriendForm::onSendTriggered()
|
||||||
QString id = toxId.text(), msg = message.toPlainText();
|
QString id = toxId.text(), msg = message.toPlainText();
|
||||||
if (id.isEmpty())
|
if (id.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
if (message.isEmpty())
|
||||||
|
msg = "Tox me maybe?";
|
||||||
|
|
||||||
emit friendRequested(id, msg);
|
emit friendRequested(id, msg);
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,6 +76,7 @@ void FriendWidget::setAsActiveChatroom()
|
||||||
QPalette pal3;
|
QPalette pal3;
|
||||||
pal3.setColor(QPalette::Background, Qt::white);
|
pal3.setColor(QPalette::Background, Qt::white);
|
||||||
this->setPalette(pal3);
|
this->setPalette(pal3);
|
||||||
|
avatar.setPixmap(QPixmap("img/contact list icons/contact_dark.png"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void FriendWidget::setAsInactiveChatroom()
|
void FriendWidget::setAsInactiveChatroom()
|
||||||
|
@ -92,4 +93,5 @@ void FriendWidget::setAsInactiveChatroom()
|
||||||
QPalette pal3;
|
QPalette pal3;
|
||||||
pal3.setColor(QPalette::Background, QColor(63,63,63,255));
|
pal3.setColor(QPalette::Background, QColor(63,63,63,255));
|
||||||
this->setPalette(pal3);
|
this->setPalette(pal3);
|
||||||
|
avatar.setPixmap(QPixmap("img/contact list icons/contact.png"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,12 +173,17 @@ void Widget::hideMainForms()
|
||||||
item->widget()->hide();
|
item->widget()->hide();
|
||||||
while ((item = ui->mainContent->layout()->takeAt(0)) != 0)
|
while ((item = ui->mainContent->layout()->takeAt(0)) != 0)
|
||||||
item->widget()->hide();
|
item->widget()->hide();
|
||||||
|
|
||||||
if (activeFriendWidget != nullptr)
|
if (activeFriendWidget != nullptr)
|
||||||
{
|
{
|
||||||
|
Friend* f = FriendList::findFriend(activeFriendWidget->friendId);
|
||||||
|
if (f != nullptr)
|
||||||
activeFriendWidget->setAsInactiveChatroom();
|
activeFriendWidget->setAsInactiveChatroom();
|
||||||
}
|
}
|
||||||
if (activeGroupWidget != nullptr)
|
if (activeGroupWidget != nullptr)
|
||||||
{
|
{
|
||||||
|
Group* g = GroupList::findGroup(activeGroupWidget->groupId);
|
||||||
|
if (g != nullptr)
|
||||||
activeGroupWidget->setAsInactiveChatroom();
|
activeGroupWidget->setAsInactiveChatroom();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user