obs-studio/frontend/components/MuteCheckBox.hpp
PatTheMav 3bbda4803e
frontend: Add renamed Qt UI components
This commit only contains Qt UI components that are self-contained,
i.e. the translation units only contain code for a single class or
interface and don't mix implementations.
2025-01-08 15:36:54 +01:00

26 lines
511 B
C++

#pragma once
#include <QCheckBox>
class MuteCheckBox : public QCheckBox {
Q_OBJECT
public:
MuteCheckBox(QWidget *parent = nullptr) : QCheckBox(parent)
{
setTristate(true);
setProperty("class", "indicator-mute");
}
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);
}
};