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

feat: Add ability to quit group with middle click

Fix #2605
This commit is contained in:
Diadlo 2017-11-23 20:27:11 +03:00
parent 65fc1dc266
commit 228c431c89
No known key found for this signature in database
GPG Key ID: 5AF9F2E29107C727

View File

@ -1911,7 +1911,15 @@ Group* Widget::createGroup(int groupId)
connect(widget, &GroupWidget::chatroomWidgetClicked, this, &Widget::onChatroomWidgetClicked);
connect(widget, &GroupWidget::newWindowOpened, this, &Widget::openNewDialog);
connect(widget, SIGNAL(removeGroup(int)), this, SLOT(removeGroup(int)));
#if (QT_VERSION >= QT_VERSION_CHECK(5, 7, 0))
auto widgetRemoveGroup = QOverload<int>::of(&Widget::removeGroup);
#else
auto widgetRemoveGroup = static_cast<void (Widget::*)(int)>(&Widget::removeGroup);
#endif
connect(widget, &GroupWidget::removeGroup, this, widgetRemoveGroup);
connect(widget, &GroupWidget::middleMouseClicked, this, [=]() {
removeGroup(groupId);
});
connect(widget, &GroupWidget::chatroomWidgetClicked, form, &ChatForm::focusInput);
connect(form, &GroupChatForm::sendMessage, core, &Core::sendGroupMessage);
connect(form, &GroupChatForm::sendAction, core, &Core::sendGroupAction);