Merge pull request #2721 from cg2121/unknown-device-label
UI: Highlight unknown audio device label in settings
This commit is contained in:
commit
f055847854
1 changed files with 20 additions and 0 deletions
|
|
@ -284,6 +284,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,
|
||||
|
|
@ -2101,6 +2119,8 @@ void OBSBasicSettings::LoadListValues(QComboBox *widget, obs_property_t *prop,
|
|||
"UnknownAudioDevice"),
|
||||
var);
|
||||
widget->setCurrentIndex(0);
|
||||
HighlightGroupBoxLabel(ui->audioDevicesGroupBox, widget,
|
||||
"errorLabel");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue