diff --git a/widget/croppinglabel.cpp b/widget/croppinglabel.cpp index 656eb2b70..f69e81c4c 100644 --- a/widget/croppinglabel.cpp +++ b/widget/croppinglabel.cpp @@ -24,7 +24,7 @@ CroppingLabel::CroppingLabel(QWidget* parent) void CroppingLabel::setText(const QString& text) { - origText = text; + origText = text.trimmed(); setElidedText(); } diff --git a/widget/friendwidget.cpp b/widget/friendwidget.cpp index 1be5817a4..84866e755 100644 --- a/widget/friendwidget.cpp +++ b/widget/friendwidget.cpp @@ -53,8 +53,6 @@ FriendWidget::FriendWidget(int FriendId, QString id) pal3.setColor(QPalette::Background, QColor(65,65,65,255)); this->setPalette(pal3); - name.setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); - textLayout.addStretch(); textLayout.addWidget(&name); textLayout.addWidget(&statusMessage); diff --git a/widget/friendwidget.h b/widget/friendwidget.h index 756578dce..3fa37649a 100644 --- a/widget/friendwidget.h +++ b/widget/friendwidget.h @@ -44,8 +44,8 @@ signals: public: int friendId; - QLabel avatar, name, statusPic; - CroppingLabel statusMessage; + QLabel avatar, statusPic; + CroppingLabel name, statusMessage; QHBoxLayout layout; QVBoxLayout textLayout; diff --git a/widget/widget.cpp b/widget/widget.cpp index 0b1a4ba51..650d2499d 100644 --- a/widget/widget.cpp +++ b/widget/widget.cpp @@ -616,7 +616,7 @@ void Widget::onGroupMessageReceived(int groupnumber, int friendgroupnumber, cons g->chatForm->addGroupMessage(message, friendgroupnumber); - if ((isGroupWidgetActive != 1 || (g->groupId != activeGroupWidget->groupId)) || isWindowMinimized || !isActiveWindow()) + if ((isGroupWidgetActive != 1 || (activeGroupWidget && g->groupId != activeGroupWidget->groupId)) || isWindowMinimized || !isActiveWindow()) { if (message.contains(core->getUsername(), Qt::CaseInsensitive)) {