UI: Highlight unknown audio device label in settings
This commit is contained in:
@@ -279,6 +279,24 @@ static std::tuple<int, int> aspect_ratio(int cx, int cy)
|
||||
return std::make_tuple(newCX, newCY);
|
||||
}
|
||||
|
||||
static inline void HighlightGroupBoxLabel(QGroupBox *gb, QWidget *widget,
|
||||
QString objectName)
|
||||
{
|
||||
QFormLayout *layout = qobject_cast<QFormLayout *>(gb->layout());
|
||||
|
||||
if (!layout)
|
||||
return;
|
||||
|
||||
QLabel *label = qobject_cast<QLabel *>(layout->labelForField(widget));
|
||||
|
||||
if (label) {
|
||||
label->setObjectName(objectName);
|
||||
|
||||
label->style()->unpolish(label);
|
||||
label->style()->polish(label);
|
||||
}
|
||||
}
|
||||
|
||||
void RestrictResetBitrates(initializer_list<QComboBox *> boxes, int maxbitrate);
|
||||
|
||||
void OBSBasicSettings::HookWidget(QWidget *widget, const char *signal,
|
||||
@@ -2096,6 +2114,8 @@ void OBSBasicSettings::LoadListValues(QComboBox *widget, obs_property_t *prop,
|
||||
"UnknownAudioDevice"),
|
||||
var);
|
||||
widget->setCurrentIndex(0);
|
||||
HighlightGroupBoxLabel(ui->audioDevicesGroupBox, widget,
|
||||
"errorLabel");
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user