From fee66e35a2e96ff07c02b697779beb638124b826 Mon Sep 17 00:00:00 2001 From: etorth Date: Mon, 18 Nov 2024 05:16:56 -0800 Subject: [PATCH] f --- client/src/gui/friendchatboard/chatitem.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/client/src/gui/friendchatboard/chatitem.cpp b/client/src/gui/friendchatboard/chatitem.cpp index 06208400..30315822 100644 --- a/client/src/gui/friendchatboard/chatitem.cpp +++ b/client/src/gui/friendchatboard/chatitem.cpp @@ -146,8 +146,8 @@ ChatItem::ChatItem( 0, 0, - ChatItem::MESSAGE_MARGIN * 2 + std::max(message.w(), ChatItem::MESSAGE_MIN_WIDTH ) + ChatItem::TRIANGLE_WIDTH, - ChatItem::MESSAGE_MARGIN * 2 + std::max(message.h(), ChatItem::MESSAGE_MIN_HEIGHT), + [this](const Widget *){ return ChatItem::MESSAGE_MARGIN * 2 + std::max(message.w(), ChatItem::MESSAGE_MIN_WIDTH ) + ChatItem::TRIANGLE_WIDTH; }, + [this](const Widget *){ return ChatItem::MESSAGE_MARGIN * 2 + std::max(message.h(), ChatItem::MESSAGE_MIN_HEIGHT) ; }, [this](const Widget *, int drawDstX, int drawDstY) { @@ -230,8 +230,9 @@ ChatItem::ChatItem( } } else{ - const auto realWidth = ChatItem::AVATAR_WIDTH + ChatItem::GAP + ChatItem::TRIANGLE_WIDTH + std::max({ - name.w(), + const auto realWidth = ChatItem::AVATAR_WIDTH + ChatItem::GAP + ChatItem::TRIANGLE_WIDTH + std::max + ({ + showName ? name.w() : 0, std::max(message.w(), ChatItem::MESSAGE_MIN_WIDTH) + ChatItem::MESSAGE_MARGIN * 2, msgref ? msgref->w() : 0, });