New upstream version 22.0.3+dfsg1

This commit is contained in:
Sebastian Ramacher 2018-12-16 17:14:58 +01:00
parent 665f64a933
commit cdc9a9fc87
334 changed files with 14525 additions and 2639 deletions

View file

@ -576,6 +576,10 @@ void OBSPropertiesView::AddEditableList(obs_property_t *prop,
for (size_t i = 0; i < count; i++) {
obs_data_t *item = obs_data_array_item(array, i);
list->addItem(QT_UTF8(obs_data_get_string(item, "value")));
list->setItemSelected(list->item((int)i),
obs_data_get_bool(item, "selected"));
list->setItemHidden(list->item((int)i),
obs_data_get_bool(item, "hidden"));
obs_data_release(item);
}
@ -634,9 +638,16 @@ void OBSPropertiesView::AddColor(obs_property_t *prop, QFormLayout *layout,
button->setText(QTStr("Basic.PropertiesWindow.SelectColor"));
button->setToolTip(QT_UTF8(obs_property_long_description(prop)));
color.setAlpha(255);
QPalette palette = QPalette(color);
colorLabel->setFrameStyle(QFrame::Sunken | QFrame::Panel);
colorLabel->setText(color.name(QColor::HexArgb));
colorLabel->setPalette(QPalette(color));
colorLabel->setPalette(palette);
colorLabel->setStyleSheet(
QString("background-color :%1; color: %2;")
.arg(palette.color(QPalette::Window).name(QColor::HexArgb))
.arg(palette.color(QPalette::WindowText).name(QColor::HexArgb)));
colorLabel->setAutoFillBackground(true);
colorLabel->setAlignment(Qt::AlignCenter);
colorLabel->setToolTip(QT_UTF8(obs_property_long_description(prop)));
@ -1626,13 +1637,19 @@ bool WidgetInfo::ColorChanged(const char *setting)
#endif
color = QColorDialog::getColor(color, view, QT_UTF8(desc), options);
color.setAlpha(255);
if (!color.isValid())
return false;
QLabel *label = static_cast<QLabel*>(widget);
label->setText(color.name(QColor::HexArgb));
label->setPalette(QPalette(color));
QPalette palette = QPalette(color);
label->setPalette(palette);
label->setStyleSheet(
QString("background-color :%1; color: %2;")
.arg(palette.color(QPalette::Window).name(QColor::HexArgb))
.arg(palette.color(QPalette::WindowText).name(QColor::HexArgb)));
obs_data_set_int(view->settings, setting, color_to_int(color));
@ -1646,11 +1663,18 @@ bool WidgetInfo::FontChanged(const char *setting)
uint32_t flags;
QFont font;
QFontDialog::FontDialogOptions options;
#ifdef __APPLE__
options = QFontDialog::DontUseNativeDialog;
#endif
if (!font_obj) {
font = QFontDialog::getFont(&success, view);
QFont initial;
font = QFontDialog::getFont(&success, initial, view, "Pick a Font", options);
} else {
MakeQFont(font_obj, font);
font = QFontDialog::getFont(&success, font, view);
font = QFontDialog::getFont(&success, font, view, "Pick a Font", options);
obs_data_release(font_obj);
}
@ -1690,7 +1714,10 @@ void WidgetInfo::EditableListChanged()
obs_data_t *arrayItem = obs_data_create();
obs_data_set_string(arrayItem, "value",
QT_TO_UTF8(item->text()));
obs_data_set_bool(arrayItem, "selected",
item->isSelected());
obs_data_set_bool(arrayItem, "hidden",
item->isHidden());
obs_data_array_push_back(array, arrayItem);
obs_data_release(arrayItem);
}