From c9ccf6e767563ffb4bf5ad7ded8174a2329e8ca1 Mon Sep 17 00:00:00 2001 From: MRXY001 Date: Wed, 11 Jan 2023 19:54:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=96=B0=E7=AA=97=E5=8F=A3?= =?UTF-8?q?=E7=9A=84=E5=A4=A7=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- notification/notificationcard.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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)