Skip to content

Commit

Permalink
优化新窗口的大小
Browse files Browse the repository at this point in the history
  • Loading branch information
iwxyi committed Jan 11, 2023
1 parent c966d63 commit c9ccf6e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions notification/notificationcard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit c9ccf6e

Please sign in to comment.