libobs/UI: Support monospace font in multiline text property

This commit is contained in:
Matt Gajownik
2019-12-29 19:55:40 +11:00
parent 9446ca5511
commit 62504dc651
3 changed files with 24 additions and 0 deletions

View File

@@ -235,6 +235,7 @@ QWidget *OBSPropertiesView::AddText(obs_property_t *prop, QFormLayout *layout,
{
const char *name = obs_property_name(prop);
const char *val = obs_data_get_string(settings, name);
const bool monospace = obs_property_text_monospace(prop);
obs_text_type type = obs_property_text_type(prop);
if (type == OBS_TEXT_MULTILINE) {
@@ -244,6 +245,11 @@ QWidget *OBSPropertiesView::AddText(obs_property_t *prop, QFormLayout *layout,
#else
edit->setTabStopWidth(40);
#endif
if (monospace) {
QFont f("Courier");
f.setStyleHint(QFont::Monospace);
edit->setFont(f);
}
return NewWidget(prop, edit, SIGNAL(textChanged()));
} else if (type == OBS_TEXT_PASSWORD) {