mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-09-20 13:08:50 +02:00
UI: Make "What's New" dialog modeless
This commit is contained in:
parent
0d4693e015
commit
8c819f9bbd
@ -1918,9 +1918,10 @@ void OBSBasic::ReceivedIntroJson(const QString &text)
|
|||||||
config_set_int(App()->GlobalConfig(), "General",
|
config_set_int(App()->GlobalConfig(), "General",
|
||||||
"InfoIncrement", info_increment);
|
"InfoIncrement", info_increment);
|
||||||
|
|
||||||
QDialog dlg(this);
|
QDialog *dlg = new QDialog(this);
|
||||||
dlg.setWindowTitle("What's New");
|
dlg->setAttribute(Qt::WA_DeleteOnClose, true);
|
||||||
dlg.resize(700, 600);
|
dlg->setWindowTitle("What's New");
|
||||||
|
dlg->resize(700, 600);
|
||||||
|
|
||||||
QCefWidget *cefWidget = cef->create_widget(nullptr, info_url);
|
QCefWidget *cefWidget = cef->create_widget(nullptr, info_url);
|
||||||
if (!cefWidget) {
|
if (!cefWidget) {
|
||||||
@ -1928,22 +1929,22 @@ void OBSBasic::ReceivedIntroJson(const QString &text)
|
|||||||
}
|
}
|
||||||
|
|
||||||
connect(cefWidget, SIGNAL(titleChanged(const QString &)),
|
connect(cefWidget, SIGNAL(titleChanged(const QString &)),
|
||||||
&dlg, SLOT(setWindowTitle(const QString &)));
|
dlg, SLOT(setWindowTitle(const QString &)));
|
||||||
|
|
||||||
QPushButton *close = new QPushButton(QTStr("Close"));
|
QPushButton *close = new QPushButton(QTStr("Close"));
|
||||||
connect(close, &QAbstractButton::clicked,
|
connect(close, &QAbstractButton::clicked,
|
||||||
&dlg, &QDialog::accept);
|
dlg, &QDialog::accept);
|
||||||
|
|
||||||
QHBoxLayout *bottomLayout = new QHBoxLayout();
|
QHBoxLayout *bottomLayout = new QHBoxLayout();
|
||||||
bottomLayout->addStretch();
|
bottomLayout->addStretch();
|
||||||
bottomLayout->addWidget(close);
|
bottomLayout->addWidget(close);
|
||||||
bottomLayout->addStretch();
|
bottomLayout->addStretch();
|
||||||
|
|
||||||
QVBoxLayout *topLayout = new QVBoxLayout(&dlg);
|
QVBoxLayout *topLayout = new QVBoxLayout(dlg);
|
||||||
topLayout->addWidget(cefWidget);
|
topLayout->addWidget(cefWidget);
|
||||||
topLayout->addLayout(bottomLayout);
|
topLayout->addLayout(bottomLayout);
|
||||||
|
|
||||||
dlg.exec();
|
dlg->show();
|
||||||
#else
|
#else
|
||||||
UNUSED_PARAMETER(text);
|
UNUSED_PARAMETER(text);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user