mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-04-12 02:29:03 -04:00
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:
@@ -623,6 +623,13 @@ void OBSBasic::ClearVolumeControls()
|
||||
volumes.clear();
|
||||
}
|
||||
|
||||
void OBSBasic::RefreshVolumeColors()
|
||||
{
|
||||
for (VolControl *vol : volumes) {
|
||||
vol->refreshColors();
|
||||
}
|
||||
}
|
||||
|
||||
obs_data_array_t *OBSBasic::SaveSceneListOrder()
|
||||
{
|
||||
obs_data_array_t *sceneOrder = obs_data_array_create();
|
||||
@@ -10099,3 +10106,42 @@ void OBSBasic::SetDisplayAffinity(QWindow *window)
|
||||
UNUSED_PARAMETER(hideFromCapture);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline QColor color_from_int(long long val)
|
||||
{
|
||||
return QColor(val & 0xff, (val >> 8) & 0xff, (val >> 16) & 0xff,
|
||||
(val >> 24) & 0xff);
|
||||
}
|
||||
|
||||
QColor OBSBasic::GetSelectionColor() const
|
||||
{
|
||||
if (config_get_bool(GetGlobalConfig(), "Accessibility",
|
||||
"OverrideColors")) {
|
||||
return color_from_int(config_get_int(
|
||||
GetGlobalConfig(), "Accessibility", "SelectRed"));
|
||||
} else {
|
||||
return QColor::fromRgb(255, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
QColor OBSBasic::GetCropColor() const
|
||||
{
|
||||
if (config_get_bool(GetGlobalConfig(), "Accessibility",
|
||||
"OverrideColors")) {
|
||||
return color_from_int(config_get_int(
|
||||
GetGlobalConfig(), "Accessibility", "SelectGreen"));
|
||||
} else {
|
||||
return QColor::fromRgb(0, 255, 0);
|
||||
}
|
||||
}
|
||||
|
||||
QColor OBSBasic::GetHoverColor() const
|
||||
{
|
||||
if (config_get_bool(GetGlobalConfig(), "Accessibility",
|
||||
"OverrideColors")) {
|
||||
return color_from_int(config_get_int(
|
||||
GetGlobalConfig(), "Accessibility", "SelectBlue"));
|
||||
} else {
|
||||
return QColor::fromRgb(0, 127, 255);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user