open settings when right clicking moderation button

This commit is contained in:
fourtf
2018-10-21 16:13:26 +02:00
parent 1872163ec4
commit 3db0b5f95c
12 changed files with 88 additions and 63 deletions
+10 -16
View File
@@ -230,33 +230,27 @@ void Button::mousePressEvent(QMouseEvent *event)
void Button::mouseReleaseEvent(QMouseEvent *event)
{
if (!this->enabled_)
{
return;
}
if (event->button() != Qt::LeftButton)
if (event->button() == Qt::LeftButton)
{
return;
this->mouseDown_ = false;
if (this->rect().contains(event->pos()))
emit leftClicked();
}
this->mouseDown_ = false;
if (this->rect().contains(event->pos()))
{
emit clicked();
}
emit clicked(event->button());
}
void Button::mouseMoveEvent(QMouseEvent *event)
{
if (!this->enabled_)
if (this->enabled_)
{
return;
this->mousePos_ = event->pos();
this->update();
}
this->mousePos_ = event->pos();
this->update();
}
void Button::onMouseEffectTimeout()
+2 -1
View File
@@ -50,7 +50,8 @@ public:
void setMenu(std::unique_ptr<QMenu> menu);
signals:
void clicked();
void leftClicked();
void clicked(Qt::MouseButton button);
void leftMousePress();
protected:
+1 -1
View File
@@ -139,7 +139,7 @@ void ChannelView::initializeLayout()
this->goToBottom_->getLabel().setText("More messages below");
this->goToBottom_->setVisible(false);
QObject::connect(this->goToBottom_, &EffectLabel::clicked, this, [=] {
QObject::connect(this->goToBottom_, &EffectLabel::leftClicked, this, [=] {
QTimer::singleShot(180, [=] {
this->scrollBar_->scrollToBottom(
getSettings()->enableSmoothScrollingNewMessages.getValue());
+1 -1
View File
@@ -150,7 +150,7 @@ void NotebookButton::mouseReleaseEvent(QMouseEvent *event)
update();
emit clicked();
emit leftClicked();
}
Button::mouseReleaseEvent(event);
+1 -1
View File
@@ -32,7 +32,7 @@ protected:
virtual void showEvent(QShowEvent *) override;
signals:
void clicked();
void leftClicked();
private:
Notebook *parent_ = nullptr;