obs-studio/UI/slider-ignorewheel.hpp
VodBox 89b4e9136f UI: Various screen reader fixes
This commit fixes various issues with screen readers in the main OBS
interface. These were tested using NVDA on Windows 10 2004.

Audio track selection in Settings now says Track 1, 2, etc, rather than
just the number.

Various checkboxes that just say "Enable" now have accessible text that
says what the enable is for (since it says "checkbox", the fact it's an
enable should hopefully be clear).

Type in the recording tab of output now has accessible text which says
"Recording Type".

Items in the Advanced Audio Properties window now have accessible text
for what they are for. Currently some do not report correct values, but
that will require an accessible interface in Qt to be written
specifically for that, which will be done at a later date.

Buttons in the filters window now have accessible text for what they do.

All the right side buttons in hotkeys now have tooltips, and by
extension, accessible text.
2020-11-25 19:38:05 -08:00

52 lines
1.1 KiB
C++

#pragma once
#include "obs.hpp"
#include <QSlider>
#include <QInputEvent>
#include <QtCore/QObject>
#include <QAccessibleWidget>
class SliderIgnoreScroll : public QSlider {
Q_OBJECT
public:
SliderIgnoreScroll(QWidget *parent = nullptr);
SliderIgnoreScroll(Qt::Orientation orientation,
QWidget *parent = nullptr);
protected:
virtual void wheelEvent(QWheelEvent *event) override;
};
class VolumeSlider : public SliderIgnoreScroll {
Q_OBJECT
public:
obs_fader_t *fad;
VolumeSlider(obs_fader_t *fader, QWidget *parent = nullptr);
VolumeSlider(obs_fader_t *fader, Qt::Orientation orientation,
QWidget *parent = nullptr);
};
class VolumeAccessibleInterface : public QAccessibleWidget {
public:
VolumeAccessibleInterface(QWidget *w);
QVariant currentValue() const;
void setCurrentValue(const QVariant &value);
QVariant maximumValue() const;
QVariant minimumValue() const;
QVariant minimumStepSize() const;
private:
VolumeSlider *slider() const;
protected:
virtual QAccessible::Role role() const override;
virtual QString text(QAccessible::Text t) const override;
};