diff --git a/notification/notificationcard.cpp b/notification/notificationcard.cpp index 616c6b1..652d9de 100644 --- a/notification/notificationcard.cpp +++ b/notification/notificationcard.cpp @@ -390,6 +390,12 @@ void NotificationCard::setPrivateMsg(const MsgBean &msg) { createPureMsgView(msg); } + else + { + int lineHeight = QFontMetrics(ui->listWidget->font()).height(); + ui->listWidget->setFixedHeight(lineHeight); + this->adjustSize(); + } connect(ui->headerLabel, &ClickLabel::leftClicked, this, [=]{ showUserInfo(this->friendId); @@ -458,6 +464,12 @@ void NotificationCard::setGroupMsg(const MsgBean &msg) { createMsgBox(msg); } + else + { + int lineHeight = QFontMetrics(ui->listWidget->font()).height(); + ui->listWidget->setFixedHeight(lineHeight); + this->adjustSize(); + } connect(sig, &SignalTransfer::groupMembersLoaded, this, [=](qint64 groupId) { if (groupId != this->groupId)