From 3db0b5f95c744db9743deb67c6d7f9c6324ba50f Mon Sep 17 00:00:00 2001 From: fourtf Date: Sun, 21 Oct 2018 16:13:26 +0200 Subject: [PATCH] open settings when right clicking moderation button --- src/util/InitUpdateButton.cpp | 2 +- src/widgets/BaseWindow.cpp | 10 ++-- src/widgets/Notebook.cpp | 6 +-- src/widgets/dialogs/UserInfoPopup.cpp | 12 ++--- src/widgets/helper/Button.cpp | 26 ++++------ src/widgets/helper/Button.hpp | 3 +- src/widgets/helper/ChannelView.cpp | 2 +- src/widgets/helper/NotebookButton.cpp | 2 +- src/widgets/helper/NotebookButton.hpp | 2 +- src/widgets/splits/Split.cpp | 9 ++-- src/widgets/splits/SplitHeader.cpp | 75 +++++++++++++++++++-------- src/widgets/splits/SplitInput.cpp | 2 +- 12 files changed, 88 insertions(+), 63 deletions(-) diff --git a/src/util/InitUpdateButton.cpp b/src/util/InitUpdateButton.cpp index 202a722e3..f2506720c 100644 --- a/src/util/InitUpdateButton.cpp +++ b/src/util/InitUpdateButton.cpp @@ -11,7 +11,7 @@ void initUpdateButton(Button &button, button.hide(); // show update prompt when clicking the button - QObject::connect(&button, &Button::clicked, [&button] { + QObject::connect(&button, &Button::leftClicked, [&button] { auto dialog = new UpdateDialog(); dialog->setActionOnFocusLoss(BaseWindow::Delete); dialog->move(button.mapToGlobal( diff --git a/src/widgets/BaseWindow.cpp b/src/widgets/BaseWindow.cpp index a8714ad34..fc22c1eda 100644 --- a/src/widgets/BaseWindow.cpp +++ b/src/widgets/BaseWindow.cpp @@ -120,19 +120,19 @@ void BaseWindow::init() TitleBarButton *_exitButton = new TitleBarButton; _exitButton->setButtonStyle(TitleBarButtonStyle::Close); - QObject::connect(_minButton, &TitleBarButton::clicked, this, + QObject::connect(_minButton, &TitleBarButton::leftClicked, this, [this] { this->setWindowState(Qt::WindowMinimized | this->windowState()); }); QObject::connect( - _maxButton, &TitleBarButton::clicked, this, [this] { + _maxButton, &TitleBarButton::leftClicked, this, [this] { this->setWindowState(this->windowState() == Qt::WindowMaximized ? Qt::WindowActive : Qt::WindowMaximized); }); - QObject::connect(_exitButton, &TitleBarButton::clicked, this, + QObject::connect(_exitButton, &TitleBarButton::leftClicked, this, [this] { this->close(); }); this->ui_.minButton = _minButton; @@ -398,7 +398,7 @@ TitleBarButton *BaseWindow::addTitleBarButton(const TitleBarButtonStyle &style, this->ui_.titlebarBox->insertWidget(1, button); button->setButtonStyle(style); - QObject::connect(button, &TitleBarButton::clicked, this, + QObject::connect(button, &TitleBarButton::leftClicked, this, [onClicked] { onClicked(); }); return button; @@ -412,7 +412,7 @@ EffectLabel *BaseWindow::addTitleBarLabel(std::function onClicked) this->ui_.buttons.push_back(button); this->ui_.titlebarBox->insertWidget(1, button); - QObject::connect(button, &EffectLabel::clicked, this, + QObject::connect(button, &EffectLabel::leftClicked, this, [onClicked] { onClicked(); }); return button; diff --git a/src/widgets/Notebook.cpp b/src/widgets/Notebook.cpp index 5dba0f28f..e6e1ca365 100644 --- a/src/widgets/Notebook.cpp +++ b/src/widgets/Notebook.cpp @@ -484,7 +484,7 @@ NotebookTab *Notebook::getTabFromPage(QWidget *page) SplitNotebook::SplitNotebook(Window *parent) : Notebook(parent) { - this->connect(this->getAddButton(), &NotebookButton::clicked, [this]() { + this->connect(this->getAddButton(), &NotebookButton::leftClicked, [this]() { QTimer::singleShot(80, this, [this] { this->addPage(true); }); }); @@ -508,7 +508,7 @@ void SplitNotebook::addCustomButtons() settingsBtn->setIcon(NotebookButton::Settings); - QObject::connect(settingsBtn, &NotebookButton::clicked, + QObject::connect(settingsBtn, &NotebookButton::leftClicked, [] { getApp()->windows->showSettingsDialog(); }); // account @@ -519,7 +519,7 @@ void SplitNotebook::addCustomButtons() this->connections_); userBtn->setIcon(NotebookButton::User); - QObject::connect(userBtn, &NotebookButton::clicked, [this, userBtn] { + QObject::connect(userBtn, &NotebookButton::leftClicked, [this, userBtn] { getApp()->windows->showAccountSelectPopup( this->mapToGlobal(userBtn->rect().bottomRight())); }); diff --git a/src/widgets/dialogs/UserInfoPopup.cpp b/src/widgets/dialogs/UserInfoPopup.cpp index 3fac00871..534d495dc 100644 --- a/src/widgets/dialogs/UserInfoPopup.cpp +++ b/src/widgets/dialogs/UserInfoPopup.cpp @@ -50,7 +50,7 @@ UserInfoPopup::UserInfoPopup() auto avatar = head.emplace