obs-studio/UI/mute-checkbox.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
469 B
C++
Raw Normal View History

2015-03-22 21:54:50 +00:00
#pragma once
#include <QCheckBox>
class MuteCheckBox : public QCheckBox {
Q_OBJECT
public:
MuteCheckBox(QWidget *parent = nullptr) : QCheckBox(parent)
{
setTristate(true);
}
protected:
/* While we need it to be tristate internally, we don't want a user being
* able to manually get into the partial state. */
void nextCheckState() override
{
if (checkState() != Qt::Checked)
setCheckState(Qt::Checked);
else
setCheckState(Qt::Unchecked);
}
2015-03-22 21:54:50 +00:00
};