1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

fix: Fixed compact layout

Fix #3944
This commit is contained in:
Diadlo 2016-12-12 01:01:55 +03:00
parent 54556803d1
commit f870bf1953
No known key found for this signature in database
GPG Key ID: 5AF9F2E29107C727
4 changed files with 28 additions and 27 deletions

View File

@ -168,10 +168,8 @@ FriendWidget* ContentDialog::addFriend(int friendId, QString id)
friendLayout->addFriendWidget(friendWidget, FriendList::findFriend(friendId)->getStatus());
Friend* frnd = friendWidget->getFriend();
const Settings& s = Settings::getInstance();
connect(frnd, &Friend::displayedNameChanged, this, &ContentDialog::updateFriendWidget);
connect(&s, &Settings::compactLayoutChanged, friendWidget, &FriendWidget::compactChange);
connect(friendWidget, &FriendWidget::chatroomWidgetClicked, this, &ContentDialog::onChatroomWidgetClicked);
connect(friendWidget, SIGNAL(chatroomWidgetClicked(GenericChatroomWidget*)), frnd->getChatForm(), SLOT(focusInput()));
connect(Core::getInstance(), &Core::friendAvatarChanged, friendWidget, &FriendWidget::onAvatarChange);
@ -193,11 +191,9 @@ GroupWidget* ContentDialog::addGroup(int groupId, const QString& name)
GroupWidget* groupWidget = new GroupWidget(groupId, name);
groupLayout.addSortedWidget(groupWidget);
const Settings& s = Settings::getInstance();
Group* group = groupWidget->getGroup();
connect(group, &Group::titleChanged, this, &ContentDialog::updateGroupWidget);
connect(group, &Group::userListChanged, this, &ContentDialog::updateGroupWidget);
connect(&s, &Settings::compactLayoutChanged, groupWidget, &GroupWidget::compactChange);
connect(groupWidget, &GroupWidget::chatroomWidgetClicked, this, &ContentDialog::onChatroomWidgetClicked);
ContentDialog* lastDialog = getGroupDialog(groupId);

View File

@ -16,33 +16,36 @@
*/
#include "friendwidget.h"
#include <cassert>
#include <QApplication>
#include <QBitmap>
#include <QCollator>
#include <QContextMenuEvent>
#include <QDebug>
#include <QDrag>
#include <QFileDialog>
#include <QInputDialog>
#include <QMenu>
#include <QMimeData>
#include "circlewidget.h"
#include "contentdialog.h"
#include "core/core.h"
#include "form/chatform.h"
#include "friend.h"
#include "friendlist.h"
#include "friendlistwidget.h"
#include "group.h"
#include "grouplist.h"
#include "groupwidget.h"
#include "circlewidget.h"
#include "friendlistwidget.h"
#include "friendlist.h"
#include "friend.h"
#include "core/core.h"
#include "form/chatform.h"
#include "maskablepixmapwidget.h"
#include "contentdialog.h"
#include "widget/tool/croppinglabel.h"
#include "widget/style.h"
#include "persistence/settings.h"
#include "widget/widget.h"
#include "widget/about/aboutuser.h"
#include <QContextMenuEvent>
#include <QMenu>
#include <QDrag>
#include <QMimeData>
#include <QApplication>
#include <QBitmap>
#include <QFileDialog>
#include <QDebug>
#include <QInputDialog>
#include <QCollator>
#include <cassert>
#include "widget/style.h"
#include "widget/tool/croppinglabel.h"
#include "widget/widget.h"
FriendWidget::FriendWidget(int FriendId, QString id)
: friendId(FriendId)

View File

@ -44,6 +44,10 @@ GenericChatroomWidget::GenericChatroomWidget(QWidget *parent)
nameLabel->setForegroundRole(QPalette::WindowText);
Settings& s = Settings::getInstance();
connect(&s, &Settings::compactLayoutChanged,
this, &GenericChatroomWidget::compactChange);
setAutoFillBackground(true);
reloadTheme();

View File

@ -1721,8 +1721,6 @@ Group *Widget::createGroup(int groupId)
newgroup->getGroupWidget()->updateStatusLight();
contactListWidget->activateWindow();
const Settings& s = Settings::getInstance();
connect(&s, &Settings::compactLayoutChanged, newgroup->getGroupWidget(), &GenericChatroomWidget::compactChange);
connect(newgroup->getGroupWidget(), SIGNAL(chatroomWidgetClicked(GenericChatroomWidget*,bool)), this, SLOT(onChatroomWidgetClicked(GenericChatroomWidget*,bool)));
connect(newgroup->getGroupWidget(), SIGNAL(removeGroup(int)), this, SLOT(removeGroup(int)));
connect(newgroup->getGroupWidget(), SIGNAL(chatroomWidgetClicked(GenericChatroomWidget*)), newgroup->getChatForm(), SLOT(focusInput()));