Open sound gain dialog on double-click

This commit is contained in:
Cacodemon345
2021-12-14 01:02:08 +06:00
parent 35b6c031d1
commit f3536e8f79
2 changed files with 3 additions and 3 deletions

View File

@@ -452,7 +452,7 @@ void MachineStatus::refresh(QStatusBar* sbar) {
d->sound = std::make_unique<ClickableLabel>(); d->sound = std::make_unique<ClickableLabel>();
d->sound->setPixmap(d->pixmaps.sound); d->sound->setPixmap(d->pixmaps.sound);
// Triggering on click makes the mouse move the window when the button is releases. Do it on button release instead. // Triggering on click makes the mouse move the window when the button is releases. Do it on button release instead.
connect(d->sound.get(), &ClickableLabel::clickedRelease, d->sound.get(), [this](QPoint pos) { connect(d->sound.get(), &ClickableLabel::doubleClicked, d->sound.get(), [this](QPoint pos) {
SoundGain gain(main_window); SoundGain gain(main_window);
gain.exec(); gain.exec();
}); });

View File

@@ -16,11 +16,11 @@ class ClickableLabel : public QLabel {
signals: signals:
void clicked(QPoint); void clicked(QPoint);
void clickedRelease(QPoint); void doubleClicked(QPoint);
protected: protected:
void mousePressEvent(QMouseEvent* event) override { emit clicked(event->globalPos()); } void mousePressEvent(QMouseEvent* event) override { emit clicked(event->globalPos()); }
void mouseReleaseEvent(QMouseEvent* event) override { emit clickedRelease(event->globalPos()); } void mouseDoubleClickEvent(QMouseEvent* event) override { emit doubleClicked(event->globalPos()); }
}; };
class MachineStatus : public QObject class MachineStatus : public QObject