Open sound gain dialog on double-click
This commit is contained in:
@@ -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();
|
||||||
});
|
});
|
||||||
|
@@ -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
|
||||||
|
Reference in New Issue
Block a user