obs-studio/UI/mute-checkbox.hpp

25 lines
469 B
C++

#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);
}
};