frontend/components: Remove NonCheckableButton

The NonCheckableButton class was previously used for situations where a
*checkable* button was meant to not be checkable by the *user*, but only
through code. This was useful mostly as a styling tool (and to confuse
developers like me as to what it actually did).

The disadvantage is that such a button - a button that is actually
checkable (has the checkable attribute) but ignores the user - still
gets recognized by QAccessible as a checkable button, which has
accessibility issues when used like a normal button (see QTBUG-110737).

We can still get the styling effect on *actually* uncheckable buttons by
giving them a class, so this widget should not be necessary.
This commit is contained in:
gxalpha 2025-01-18 15:54:46 +01:00 • committed by Ryan Foster
commit 28960a48a7
2 changed files with 0 additions and 19 deletions

View file

@ -45,7 +45,6 @@ target_sources(
components/Multiview.cpp
components/Multiview.hpp
components/MuteCheckBox.hpp
components/NonCheckableButton.hpp
components/OBSAdvAudioCtrl.cpp
components/OBSAdvAudioCtrl.hpp
components/OBSPreviewScalingComboBox.cpp

View file

@ -1,18 +0,0 @@
#pragma once
#include <QPushButton>
#include <QString>
#include <QWidget>
/* Button with its checked property not changed when clicked.
* Meant to be used in situations where manually changing the property
* is always preferred. */
class NonCheckableButton : public QPushButton {
Q_OBJECT
inline void nextCheckState() override {}
public:
inline NonCheckableButton(QWidget *parent = nullptr) : QPushButton(parent) {}
inline NonCheckableButton(const QString &text, QWidget *parent = nullptr) : QPushButton(text, parent) {}
};