From 62873e9d718794fbaaea73732ef6c5c8472ff51a Mon Sep 17 00:00:00 2001 From: TheSpiritXIII Date: Wed, 10 Jun 2015 12:11:50 -0400 Subject: [PATCH] Fix circle related rebase bugs --- src/group.cpp | 2 +- src/widget/circlewidget.cpp | 27 ++++++------ src/widget/circlewidget.h | 17 ++++---- src/widget/form/chatform.cpp | 1 + src/widget/friendlistlayout.cpp | 6 +-- src/widget/friendlistwidget.cpp | 16 ++----- src/widget/friendlistwidget.h | 2 +- src/widget/friendwidget.cpp | 16 +++++-- src/widget/genericchatroomwidget.cpp | 37 +++++++---------- src/widget/genericchatroomwidget.h | 30 +++++++------- src/widget/groupwidget.cpp | 62 ++++++++++++---------------- src/widget/groupwidget.h | 7 ++-- src/widget/tool/croppinglabel.cpp | 14 +++++-- src/widget/tool/croppinglabel.h | 13 +++--- src/widget/widget.cpp | 4 +- 15 files changed, 119 insertions(+), 135 deletions(-) diff --git a/src/group.cpp b/src/group.cpp index 8c430c362..59615139e 100644 --- a/src/group.cpp +++ b/src/group.cpp @@ -43,7 +43,7 @@ Group::Group(int GroupId, QString Name, bool IsAvGroupchat) Group::~Group() { delete chatForm; - delete widget; + widget->deleteLater(); } /* diff --git a/src/widget/circlewidget.cpp b/src/widget/circlewidget.cpp index 30a877632..fa4973de2 100644 --- a/src/widget/circlewidget.cpp +++ b/src/widget/circlewidget.cpp @@ -31,13 +31,6 @@ #include #include -void maxCropLabel(CroppingLabel* label) -{ - QFontMetrics metrics = label->fontMetrics(); - // Text width + padding. Without padding, we'll have elipses. - label->setMaximumWidth(metrics.width(label->fullText()) + metrics.width("...")); -} - QHash CircleWidget::circleList; CircleWidget::CircleWidget(FriendListWidget *parent, int id_) @@ -85,9 +78,13 @@ CircleWidget::CircleWidget(FriendListWidget *parent, int id_) connect(nameLabel, &CroppingLabel::editFinished, [this](const QString &newName) { if (!newName.isEmpty()) - { - emit renameRequested(newName); - } + emit renameRequested(this, newName); + }); + + connect(nameLabel, &CroppingLabel::editRemoved, [this]() + { + if (isCompact()) + nameLabel->minimizeMaximumWidth(); }); bool isNew = false; @@ -150,12 +147,12 @@ void CircleWidget::setName(const QString &name) nameLabel->setText(name); Settings::getInstance().setCircleName(id, name); if (isCompact()) - maxCropLabel(nameLabel); + nameLabel->minimizeMaximumWidth(); } void CircleWidget::renameCircle() { - nameLabel->editStart(); + nameLabel->editBegin(); nameLabel->setMaximumWidth(QWIDGETSIZE_MAX); } @@ -279,7 +276,7 @@ void CircleWidget::onCompactChanged(bool _compact) if (property("compact").toBool()) { - maxCropLabel(nameLabel); + nameLabel->minimizeMaximumWidth(); mainLayout = nullptr; @@ -335,7 +332,7 @@ void CircleWidget::contextMenuEvent(QContextMenuEvent *event) renameCircle(); else if (selectedItem == removeAction) { - FriendListWidget *friendList = static_cast(parentWidget()); + FriendListWidget* friendList = dynamic_cast(parentWidget()); listLayout->moveFriendWidgets(friendList); friendList->removeCircleWidget(this); @@ -349,7 +346,7 @@ void CircleWidget::contextMenuEvent(QContextMenuEvent *event) } } -void CircleWidget::mousePressEvent(QMouseEvent *event) +void CircleWidget::mouseReleaseEvent(QMouseEvent *event) { if (event->button() == Qt::LeftButton) setExpanded(!expanded); diff --git a/src/widget/circlewidget.h b/src/widget/circlewidget.h index 9d7601526..9c3834637 100644 --- a/src/widget/circlewidget.h +++ b/src/widget/circlewidget.h @@ -25,7 +25,7 @@ class FriendListWidget; class FriendListLayout; class FriendWidget; -class CircleWidget : public GenericChatItemWidget +class CircleWidget final : public GenericChatItemWidget { Q_OBJECT public: @@ -49,20 +49,17 @@ public: static CircleWidget* getFromID(int id); signals: - void renameRequested(const QString &newName); + void renameRequested(CircleWidget* circleWidget, const QString &newName); public slots: void onCompactChanged(bool compact); protected: - - void contextMenuEvent(QContextMenuEvent* event); - - void mousePressEvent(QMouseEvent* event) override; - - void dragEnterEvent(QDragEnterEvent* event) override; - void dragLeaveEvent(QDragLeaveEvent* event) override; - void dropEvent(QDropEvent* event) override; + virtual void contextMenuEvent(QContextMenuEvent* event) final override; + virtual void mouseReleaseEvent(QMouseEvent* event) final override; + virtual void dragEnterEvent(QDragEnterEvent* event) final override; + virtual void dragLeaveEvent(QDragLeaveEvent* event) final override; + virtual void dropEvent(QDropEvent* event) final override; private: void updateID(int index); diff --git a/src/widget/form/chatform.cpp b/src/widget/form/chatform.cpp index 78390e59b..ca74013a7 100644 --- a/src/widget/form/chatform.cpp +++ b/src/widget/form/chatform.cpp @@ -18,6 +18,7 @@ */ #include +#include #include #include #include diff --git a/src/widget/friendlistlayout.cpp b/src/widget/friendlistlayout.cpp index 143f19037..28d7168f7 100644 --- a/src/widget/friendlistlayout.cpp +++ b/src/widget/friendlistlayout.cpp @@ -42,8 +42,8 @@ FriendListLayout::FriendListLayout(QWidget* parent) void FriendListLayout::addFriendWidget(FriendWidget* w, Status s) { - friendOfflineLayout.getLayout()->removeWidget(w); - friendOnlineLayout.getLayout()->removeWidget(w); + friendOfflineLayout.removeSortedWidget(w); + friendOnlineLayout.removeSortedWidget(w); if (s == Status::Offline) { friendOfflineLayout.addSortedWidget(w); @@ -64,7 +64,6 @@ void FriendListLayout::moveFriendWidgets(FriendListWidget* listWidget) while (friendOnlineLayout.getLayout()->count() != 0) { QWidget* getWidget = friendOnlineLayout.getLayout()->takeAt(0)->widget(); - assert(getWidget != nullptr); FriendWidget* friendWidget = dynamic_cast(getWidget); listWidget->moveWidget(friendWidget, FriendList::findFriend(friendWidget->friendId)->getStatus(), true); @@ -72,7 +71,6 @@ void FriendListLayout::moveFriendWidgets(FriendListWidget* listWidget) while (friendOfflineLayout.getLayout()->count() != 0) { QWidget* getWidget = friendOfflineLayout.getLayout()->takeAt(0)->widget(); - assert(getWidget != nullptr); FriendWidget* friendWidget = dynamic_cast(getWidget); listWidget->moveWidget(friendWidget, FriendList::findFriend(friendWidget->friendId)->getStatus(), true); diff --git a/src/widget/friendlistwidget.cpp b/src/widget/friendlistwidget.cpp index f4d3fedc4..1e31dbae5 100644 --- a/src/widget/friendlistwidget.cpp +++ b/src/widget/friendlistwidget.cpp @@ -60,7 +60,7 @@ void FriendListWidget::addGroupWidget(GroupWidget* widget) // Only rename group if groups are visible. if (Widget::getInstance()->groupsVisible()) - widget->rename(); + widget->editName(); } void FriendListWidget::addFriendWidget(FriendWidget* w, Status s, int circleIndex) @@ -116,17 +116,10 @@ void FriendListWidget::renameGroupWidget(GroupWidget* groupWidget, const QString groupLayout.removeSortedWidget(groupWidget); groupWidget->setName(newName); groupLayout.addSortedWidget(groupWidget); - reDraw(); // Prevent artifacts. } -void FriendListWidget::renameCircleWidget(const QString &newName) +void FriendListWidget::renameCircleWidget(CircleWidget* circleWidget, const QString &newName) { - assert(sender() != nullptr); - - CircleWidget* circleWidget = static_cast(sender()); - assert(circleWidget != nullptr); - - // Rename after removing so you can find it successfully. circleLayout.removeSortedWidget(circleWidget); circleWidget->setName(newName); circleLayout.addSortedWidget(circleWidget); @@ -271,13 +264,10 @@ void FriendListWidget::dropEvent(QDropEvent* event) // Update old circle after moved. CircleWidget* circleWidget = CircleWidget::getFromID(Settings::getInstance().getFriendCircleID(f->getToxId())); - listLayout->addFriendWidget(widget, f->getStatus()); + moveWidget(widget, f->getStatus(), true); if (circleWidget != nullptr) - { - // In case the status was changed while moving, update both. circleWidget->updateStatus(); - } } } diff --git a/src/widget/friendlistwidget.h b/src/widget/friendlistwidget.h index 891b2ea1e..189eee263 100644 --- a/src/widget/friendlistwidget.h +++ b/src/widget/friendlistwidget.h @@ -57,7 +57,7 @@ signals: public slots: void renameGroupWidget(GroupWidget* groupWidget, const QString& newName); - void renameCircleWidget(const QString& newName); + void renameCircleWidget(CircleWidget* circleWidget, const QString& newName); void onGroupchatPositionChanged(bool top); void moveWidget(FriendWidget* w, Status s, bool add = false); diff --git a/src/widget/friendwidget.cpp b/src/widget/friendwidget.cpp index 635957d3e..506adec4f 100644 --- a/src/widget/friendwidget.cpp +++ b/src/widget/friendwidget.cpp @@ -57,6 +57,11 @@ FriendWidget::FriendWidget(int FriendId, QString id) void FriendWidget::contextMenuEvent(QContextMenuEvent * event) { + if (!active) + setBackgroundRole(QPalette::Highlight); + + installEventFilter(this); // Disable leave event. + QPoint pos = event->globalPos(); ToxId id = FriendList::findFriend(friendId)->getToxId(); QString dir = Settings::getInstance().getAutoAcceptDir(id); @@ -90,7 +95,6 @@ void FriendWidget::contextMenuEvent(QContextMenuEvent * event) friendList = dynamic_cast(circleWidget->parentWidget()); assert(friendList != nullptr); - friendList->reDraw(); QVector circleVec = friendList->getAllCircles(); QMap circleActions; @@ -114,6 +118,12 @@ void FriendWidget::contextMenuEvent(QContextMenuEvent * event) QAction* removeFriendAction = menu.addAction(tr("Remove friend", "Menu to remove the friend from our friendlist")); QAction* selectedItem = menu.exec(pos); + + removeEventFilter(this); + + if (!active) + setBackgroundRole(QPalette::Window); + if (selectedItem) { if (selectedItem == copyId) @@ -122,7 +132,7 @@ void FriendWidget::contextMenuEvent(QContextMenuEvent * event) return; } else if (selectedItem == setAlias) { - nameLabel->editStart(); + nameLabel->editBegin(); } else if (selectedItem == removeFriendAction) { @@ -326,6 +336,4 @@ void FriendWidget::setAlias(const QString& _alias) f->setAlias(alias); Settings::getInstance().setFriendAlias(f->getToxId(), alias); Settings::getInstance().savePersonal(); - //hide(); - //show(); } diff --git a/src/widget/genericchatroomwidget.cpp b/src/widget/genericchatroomwidget.cpp index 0b4acd2bf..09983df98 100644 --- a/src/widget/genericchatroomwidget.cpp +++ b/src/widget/genericchatroomwidget.cpp @@ -22,14 +22,14 @@ #include "src/persistence/settings.h" #include "maskablepixmapwidget.h" #include "src/widget/tool/croppinglabel.h" +#include #include GenericChatroomWidget::GenericChatroomWidget(QWidget *parent) - : GenericChatItemWidget(parent), compact{Settings::getInstance().getCompactLayout()}, - active{false} + : GenericChatItemWidget(parent), active{false} { // avatar - if (compact) + if (isCompact()) avatar = new MaskablePixmapWidget(this, QSize(20,20), ":/img/avatar_mask.svg"); else avatar = new MaskablePixmapWidget(this, QSize(40,40), ":/img/avatar_mask.svg"); @@ -39,23 +39,26 @@ GenericChatroomWidget::GenericChatroomWidget(QWidget *parent) statusMessageLabel->setTextFormat(Qt::PlainText); statusMessageLabel->setForegroundRole(QPalette::WindowText); - nameLabel->setTextFormat(Qt::PlainText); nameLabel->setForegroundRole(QPalette::WindowText); setAutoFillBackground(true); reloadTheme(); - setCompact(compact); + + compactChange(isCompact()); } -void GenericChatroomWidget::setCompact(bool _compact) +bool GenericChatroomWidget::eventFilter(QObject *, QEvent *) { - compact = _compact; + return true; // Disable all events. +} + +void GenericChatroomWidget::compactChange(bool _compact) +{ + setCompact(_compact); delete textLayout; // has to be first, deleted by layout delete mainLayout; - compact = _compact; - mainLayout = new QHBoxLayout; textLayout = new QVBoxLayout; @@ -67,7 +70,7 @@ void GenericChatroomWidget::setCompact(bool _compact) setLayoutDirection(Qt::LeftToRight); // parent might have set Qt::RightToLeft // avatar - if (compact) + if (isCompact()) { setFixedHeight(25); avatar->setSize(QSize(20,20)); @@ -162,17 +165,6 @@ void GenericChatroomWidget::reloadTheme() setPalette(p); } -bool GenericChatroomWidget::isCompact() const -{ - return compact; -} - -void GenericChatroomWidget::mousePressEvent(QMouseEvent* event) -{ - if (!active && event->button() == Qt::RightButton) - setBackgroundRole(QPalette::Window); -} - void GenericChatroomWidget::mouseReleaseEvent(QMouseEvent*) { emit chatroomWidgetClicked(this); @@ -184,8 +176,9 @@ void GenericChatroomWidget::enterEvent(QEvent*) setBackgroundRole(QPalette::Highlight); } -void GenericChatroomWidget::leaveEvent(QEvent*) +void GenericChatroomWidget::leaveEvent(QEvent* event) { if (!active) setBackgroundRole(QPalette::Window); + QWidget::leaveEvent(event); } diff --git a/src/widget/genericchatroomwidget.h b/src/widget/genericchatroomwidget.h index d202072cc..dcccb2985 100644 --- a/src/widget/genericchatroomwidget.h +++ b/src/widget/genericchatroomwidget.h @@ -21,11 +21,11 @@ #define GENERICCHATROOMWIDGET_H #include "genericchatitemwidget.h" -#include -#include class CroppingLabel; class MaskablePixmapWidget; +class QVBoxLayout; +class QHBoxLayout; namespace Ui { class MainWindow; @@ -37,34 +37,32 @@ class GenericChatroomWidget : public GenericChatItemWidget public: GenericChatroomWidget(QWidget *parent = 0); - virtual void setAsActiveChatroom(){;} - virtual void setAsInactiveChatroom(){;} - virtual void updateStatusLight(){;} - virtual void setChatForm(Ui::MainWindow &){;} - virtual void resetEventFlags(){;} - virtual QString getStatusString(){return QString::null;} + virtual void setAsActiveChatroom() = 0; + virtual void setAsInactiveChatroom() = 0; + virtual void updateStatusLight() = 0; + virtual void setChatForm(Ui::MainWindow &) = 0; + virtual void resetEventFlags() = 0; + virtual QString getStatusString() = 0; + + virtual bool eventFilter(QObject *, QEvent *) final override; bool isActive(); void setActive(bool active); void setName(const QString& name); void setStatusMsg(const QString& status); - QString getStatusMsg() const; - void reloadTheme(); - - bool isCompact() const; + void reloadTheme(); public slots: - void setCompact(bool compact); + void compactChange(bool compact); signals: void chatroomWidgetClicked(GenericChatroomWidget* widget); protected: - virtual void mousePressEvent(QMouseEvent* event) override; - virtual void mouseReleaseEvent (QMouseEvent* event) override; + virtual void mouseReleaseEvent(QMouseEvent* event) override; virtual void enterEvent(QEvent* e) override; virtual void leaveEvent(QEvent* e) override; @@ -74,7 +72,7 @@ protected: QVBoxLayout* textLayout = nullptr; MaskablePixmapWidget* avatar; CroppingLabel* statusMessageLabel; - bool compact, active; + bool active; }; #endif // GENERICCHATROOMWIDGET_H diff --git a/src/widget/groupwidget.cpp b/src/widget/groupwidget.cpp index 1fb18166e..4e78d71b5 100644 --- a/src/widget/groupwidget.cpp +++ b/src/widget/groupwidget.cpp @@ -18,23 +18,18 @@ */ #include "groupwidget.h" +#include "maskablepixmapwidget.h" #include "src/grouplist.h" #include "src/group.h" -#include "src/persistence/settings.h" #include "form/groupchatform.h" -#include "maskablepixmapwidget.h" -#include "friendlistwidget.h" #include "src/widget/style.h" #include "src/core/core.h" +#include "tool/croppinglabel.h" #include #include #include -#include #include -#include - -#include "ui_mainwindow.h" - +#include GroupWidget::GroupWidget(int GroupId, QString Name) : groupId{GroupId} @@ -44,11 +39,7 @@ GroupWidget::GroupWidget(int GroupId, QString Name) statusPic.setMargin(3); nameLabel->setText(Name); - Group* g = GroupList::findGroup(groupId); - if (g) - statusMessageLabel->setText(GroupWidget::tr("%1 users in chat").arg(g->getPeersCount())); - else - statusMessageLabel->setText(GroupWidget::tr("0 users in chat")); + onUserListChanged(); setAcceptDrops(true); @@ -60,27 +51,27 @@ GroupWidget::GroupWidget(int GroupId, QString Name) emit renameRequested(this, newName); emit g->getChatForm()->groupTitleChanged(groupId, newName.left(128)); } - /* according to agilob: - * “Moving mouse pointer over groupwidget results in CSS effect - * mouse-over(?). Changing group title repaints only changed - * element - title, the rest of the widget stays in the same CSS as it - * was on mouse over. Repainting whole widget fixes style problem.” - */ - this->repaint(); }); } -void GroupWidget::contextMenuEvent(QContextMenuEvent * event) +void GroupWidget::contextMenuEvent(QContextMenuEvent* event) { - QPoint pos = event->globalPos(); - QMenu menu; + if (!active) + setBackgroundRole(QPalette::Highlight); + + installEventFilter(this); // Disable leave event. + + QMenu menu(this); QAction* setTitle = menu.addAction(tr("Set title...")); QAction* quitGroup = menu.addAction(tr("Quit group","Menu to quit a groupchat")); - FriendListWidget *friendList = static_cast(parentWidget()); - friendList->reDraw(); + QAction* selectedItem = menu.exec(event->globalPos()); + + removeEventFilter(this); + + if (!active) + setBackgroundRole(QPalette::Window); - QAction* selectedItem = menu.exec(pos); if (selectedItem) { if (selectedItem == quitGroup) @@ -89,7 +80,7 @@ void GroupWidget::contextMenuEvent(QContextMenuEvent * event) } else if (selectedItem == setTitle) { - nameLabel->editStart(); + editName(); } } } @@ -141,9 +132,9 @@ QString GroupWidget::getStatusString() return "New Message"; } -void GroupWidget::rename() +void GroupWidget::editName() { - nameLabel->editStart(); + nameLabel->editBegin(); } void GroupWidget::setChatForm(Ui::MainWindow &ui) @@ -163,14 +154,15 @@ void GroupWidget::dragEnterEvent(QDragEnterEvent *ev) { if (ev->mimeData()->hasFormat("friend")) ev->acceptProposedAction(); - setAttribute(Qt::WA_UnderMouse, true); // Simulate hover. - Style::repolish(this); + + if (!active) + setBackgroundRole(QPalette::Highlight); } void GroupWidget::dragLeaveEvent(QDragLeaveEvent *) { - setAttribute(Qt::WA_UnderMouse, false); - Style::repolish(this); + if (!active) + setBackgroundRole(QPalette::Window); } void GroupWidget::dropEvent(QDropEvent *ev) @@ -180,8 +172,8 @@ void GroupWidget::dropEvent(QDropEvent *ev) int friendId = ev->mimeData()->data("friend").toInt(); Core::getInstance()->groupInviteFriend(friendId, groupId); - setAttribute(Qt::WA_UnderMouse, false); - Style::repolish(this); + if (!active) + setBackgroundRole(QPalette::Window); } } diff --git a/src/widget/groupwidget.h b/src/widget/groupwidget.h index 8165bfd62..371a586de 100644 --- a/src/widget/groupwidget.h +++ b/src/widget/groupwidget.h @@ -22,12 +22,11 @@ #include "genericchatroomwidget.h" -class GroupWidget : public GenericChatroomWidget +class GroupWidget final : public GenericChatroomWidget { Q_OBJECT public: GroupWidget(int GroupId, QString Name); - virtual void contextMenuEvent(QContextMenuEvent * event) final override; virtual void setAsInactiveChatroom() final override; virtual void setAsActiveChatroom() final override; virtual void updateStatusLight() final override; @@ -36,7 +35,7 @@ public: virtual QString getStatusString() final override; void setName(const QString& name); void onUserListChanged(); - void rename(); + void editName(); signals: void groupWidgetClicked(GroupWidget* widget); @@ -44,7 +43,7 @@ signals: void removeGroup(int groupId); protected: - // drag & drop + virtual void contextMenuEvent(QContextMenuEvent * event) final override; virtual void dragEnterEvent(QDragEnterEvent* ev) override; virtual void dragLeaveEvent(QDragLeaveEvent* ev); virtual void dropEvent(QDropEvent* ev) override; diff --git a/src/widget/tool/croppinglabel.cpp b/src/widget/tool/croppinglabel.cpp index 26fa7d313..45979f2b7 100644 --- a/src/widget/tool/croppinglabel.cpp +++ b/src/widget/tool/croppinglabel.cpp @@ -35,10 +35,10 @@ CroppingLabel::CroppingLabel(QWidget* parent) | Qt::ImhNoPredictiveText | Qt::ImhPreferLatin); - connect(textEdit, &QLineEdit::editingFinished, this, &CroppingLabel::finishTextEdit); + connect(textEdit, &QLineEdit::editingFinished, this, &CroppingLabel::editingFinished); } -void CroppingLabel::editStart() +void CroppingLabel::editBegin() { showTextEdit(); textEdit->selectAll(); @@ -127,7 +127,14 @@ QString CroppingLabel::fullText() return origText; } -void CroppingLabel::finishTextEdit() +void CroppingLabel::minimizeMaximumWidth() +{ + // This function chooses the smallest possible maximum width. + // Text width + padding. Without padding, we'll have elipses. + setMaximumWidth(fontMetrics().width(origText) + fontMetrics().width("...")); +} + +void CroppingLabel::editingFinished() { QString newText = textEdit->text().trimmed().remove(QRegExp("[\\t\\n\\v\\f\\r\\x0000]")); if (origText != newText) @@ -137,4 +144,5 @@ void CroppingLabel::finishTextEdit() textEdit->hide(); blockPaintEvents = false; + emit editRemoved(); } diff --git a/src/widget/tool/croppinglabel.h b/src/widget/tool/croppinglabel.h index b06978204..1cb11f1ce 100644 --- a/src/widget/tool/croppinglabel.h +++ b/src/widget/tool/croppinglabel.h @@ -1,5 +1,5 @@ /* - Copyright © 2014 by The qTox Project + Copyright © 2014-2015 by The qTox Project This file is part of qTox, a Qt-based graphical interface for Tox. @@ -30,16 +30,19 @@ class CroppingLabel : public QLabel public: explicit CroppingLabel(QWidget* parent = 0); - void editStart(); + void editBegin(); void setEditable(bool editable); void setEdlideMode(Qt::TextElideMode elide); void setText(const QString& text); QString fullText(); ///< Returns the un-cropped text +public slots: + void minimizeMaximumWidth(); + signals: - void editFinished(QString newText); - void textChanged(QString newText, QString oldText); + void editFinished(const QString& newText); + void editRemoved(); void clicked(); protected: @@ -53,7 +56,7 @@ protected: virtual void mouseReleaseEvent(QMouseEvent *e) final override; private slots: - void finishTextEdit(); + void editingFinished(); private: QString origText; diff --git a/src/widget/widget.cpp b/src/widget/widget.cpp index ec5a79f8d..07d634356 100644 --- a/src/widget/widget.cpp +++ b/src/widget/widget.cpp @@ -587,7 +587,7 @@ void Widget::addFriend(int friendId, const QString &userId) Core* core = Nexus::getCore(); connect(newfriend, &Friend::displayedNameChanged, this, &Widget::onFriendDisplayChanged); - connect(settingsWidget, &SettingsWidget::compactToggled, newfriend->getFriendWidget(), &GenericChatroomWidget::setCompact); + connect(settingsWidget, &SettingsWidget::compactToggled, newfriend->getFriendWidget(), &GenericChatroomWidget::compactChange); connect(newfriend->getFriendWidget(), SIGNAL(chatroomWidgetClicked(GenericChatroomWidget*)), this, SLOT(onChatroomWidgetClicked(GenericChatroomWidget*))); connect(newfriend->getFriendWidget(), SIGNAL(removeFriend(int)), this, SLOT(removeFriend(int))); connect(newfriend->getFriendWidget(), SIGNAL(copyFriendIdToClipboard(int)), this, SLOT(copyFriendIdToClipboard(int))); @@ -1061,7 +1061,7 @@ Group *Widget::createGroup(int groupId) contactListWidget->addGroupWidget(newgroup->getGroupWidget()); newgroup->getGroupWidget()->updateStatusLight(); - connect(settingsWidget, &SettingsWidget::compactToggled, newgroup->getGroupWidget(), &GenericChatroomWidget::setCompact); + connect(settingsWidget, &SettingsWidget::compactToggled, newgroup->getGroupWidget(), &GenericChatroomWidget::compactChange); connect(newgroup->getGroupWidget(), SIGNAL(chatroomWidgetClicked(GenericChatroomWidget*)), this, SLOT(onChatroomWidgetClicked(GenericChatroomWidget*))); connect(newgroup->getGroupWidget(), SIGNAL(removeGroup(int)), this, SLOT(removeGroup(int))); connect(newgroup->getGroupWidget(), SIGNAL(chatroomWidgetClicked(GenericChatroomWidget*)), newgroup->getChatForm(), SLOT(focusInput()));