UI: Add Accessibility menu to settings
This change introduces an accessibility menu to settings, along with options for overriding the colors used by OBS in the mixer and in the preview to be more color blind friendly than the options provided by the current theme.
This commit is contained in:
parent
9299a3dbce
commit
77694d76e8
16 changed files with 1816 additions and 21 deletions
|
|
@ -350,6 +350,7 @@ void OBSBasicSettings::HookWidget(QWidget *widget, const char *signal,
|
|||
#define VIDEO_RESTART SLOT(VideoChangedRestart())
|
||||
#define VIDEO_RES SLOT(VideoChangedResolution())
|
||||
#define VIDEO_CHANGED SLOT(VideoChanged())
|
||||
#define A11Y_CHANGED SLOT(A11yChanged())
|
||||
#define ADV_CHANGED SLOT(AdvancedChanged())
|
||||
#define ADV_RESTART SLOT(AdvancedChangedRestart())
|
||||
/* clang-format on */
|
||||
|
|
@ -528,6 +529,8 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
|||
HookWidget(ui->fpsInteger, SCROLL_CHANGED, VIDEO_CHANGED);
|
||||
HookWidget(ui->fpsNumerator, SCROLL_CHANGED, VIDEO_CHANGED);
|
||||
HookWidget(ui->fpsDenominator, SCROLL_CHANGED, VIDEO_CHANGED);
|
||||
HookWidget(ui->colorsGroupBox, CHECK_CHANGED, A11Y_CHANGED);
|
||||
HookWidget(ui->colorPreset, COMBO_CHANGED, A11Y_CHANGED);
|
||||
HookWidget(ui->renderer, COMBO_CHANGED, ADV_RESTART);
|
||||
HookWidget(ui->adapter, COMBO_CHANGED, ADV_RESTART);
|
||||
HookWidget(ui->colorFormat, COMBO_CHANGED, ADV_CHANGED);
|
||||
|
|
@ -3026,6 +3029,8 @@ void OBSBasicSettings::LoadSettings(bool changedOnly)
|
|||
LoadVideoSettings();
|
||||
if (!changedOnly || hotkeysChanged)
|
||||
LoadHotkeySettings();
|
||||
if (!changedOnly || a11yChanged)
|
||||
LoadA11ySettings();
|
||||
if (!changedOnly || advancedChanged)
|
||||
LoadAdvancedSettings();
|
||||
}
|
||||
|
|
@ -3806,6 +3811,8 @@ void OBSBasicSettings::SaveSettings()
|
|||
SaveVideoSettings();
|
||||
if (hotkeysChanged)
|
||||
SaveHotkeySettings();
|
||||
if (a11yChanged)
|
||||
SaveA11ySettings();
|
||||
if (advancedChanged)
|
||||
SaveAdvancedSettings();
|
||||
|
||||
|
|
@ -3830,6 +3837,8 @@ void OBSBasicSettings::SaveSettings()
|
|||
AddChangedVal(changed, "video");
|
||||
if (hotkeysChanged)
|
||||
AddChangedVal(changed, "hotkeys");
|
||||
if (a11yChanged)
|
||||
AddChangedVal(changed, "a11y");
|
||||
if (advancedChanged)
|
||||
AddChangedVal(changed, "advanced");
|
||||
|
||||
|
|
@ -4544,6 +4553,15 @@ void OBSBasicSettings::ReloadHotkeys(obs_hotkey_id ignoreKey)
|
|||
LoadHotkeySettings(ignoreKey);
|
||||
}
|
||||
|
||||
void OBSBasicSettings::A11yChanged()
|
||||
{
|
||||
if (!loading) {
|
||||
a11yChanged = true;
|
||||
sender()->setProperty("changed", QVariant(true));
|
||||
EnableApplyButton(true);
|
||||
}
|
||||
}
|
||||
|
||||
void OBSBasicSettings::AdvancedChanged()
|
||||
{
|
||||
if (!loading) {
|
||||
|
|
@ -5278,6 +5296,11 @@ QIcon OBSBasicSettings::GetHotkeysIcon() const
|
|||
return hotkeysIcon;
|
||||
}
|
||||
|
||||
QIcon OBSBasicSettings::GetAccessibilityIcon() const
|
||||
{
|
||||
return accessibilityIcon;
|
||||
}
|
||||
|
||||
QIcon OBSBasicSettings::GetAdvancedIcon() const
|
||||
{
|
||||
return advancedIcon;
|
||||
|
|
@ -5313,11 +5336,16 @@ void OBSBasicSettings::SetHotkeysIcon(const QIcon &icon)
|
|||
ui->listWidget->item(5)->setIcon(icon);
|
||||
}
|
||||
|
||||
void OBSBasicSettings::SetAdvancedIcon(const QIcon &icon)
|
||||
void OBSBasicSettings::SetAccessibilityIcon(const QIcon &icon)
|
||||
{
|
||||
ui->listWidget->item(6)->setIcon(icon);
|
||||
}
|
||||
|
||||
void OBSBasicSettings::SetAdvancedIcon(const QIcon &icon)
|
||||
{
|
||||
ui->listWidget->item(7)->setIcon(icon);
|
||||
}
|
||||
|
||||
int OBSBasicSettings::CurrentFLVTrack()
|
||||
{
|
||||
if (ui->flvTrack1->isChecked())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue