Fix build for Windows, add BoxShowFinishes.
This commit is contained in:
parent
c538357107
commit
2fe9ec27b1
3 changed files with 18 additions and 3 deletions
|
|
@ -70,4 +70,17 @@ not_null<Ui::VerticalLayout*> GenericBox::verticalLayout() {
|
|||
return _content;
|
||||
}
|
||||
|
||||
rpl::producer<> BoxShowFinishes(not_null<GenericBox*> box) {
|
||||
const auto singleShot = box->lifetime().make_state<rpl::lifetime>();
|
||||
const auto showFinishes = singleShot->make_state<rpl::event_stream<>>();
|
||||
|
||||
box->setShowFinishedCallback([=] {
|
||||
showFinishes->fire({});
|
||||
singleShot->destroy();
|
||||
box->setShowFinishedCallback(nullptr);
|
||||
});
|
||||
|
||||
return showFinishes->events();
|
||||
}
|
||||
|
||||
} // namespace Ui
|
||||
|
|
|
|||
|
|
@ -192,4 +192,6 @@ inline GenericBox::GenericBox(
|
|||
, _content(_owned.data()) {
|
||||
}
|
||||
|
||||
[[nodiscard]] rpl::producer<> BoxShowFinishes(not_null<GenericBox*> box);
|
||||
|
||||
} // namespace Ui
|
||||
|
|
|
|||
|
|
@ -48,9 +48,9 @@ TWidget::TWidget(QWidget *parent)
|
|||
[[maybe_unused]] static const auto Once = [] {
|
||||
auto format = QSurfaceFormat::defaultFormat();
|
||||
format.setSwapInterval(0);
|
||||
if (Platform::IsMac()) {
|
||||
format.setColorSpace(QColorSpace::SRgb);
|
||||
}
|
||||
#ifdef Q_OS_MAC
|
||||
format.setColorSpace(QColorSpace::SRgb);
|
||||
#endif // Q_OS_MAC
|
||||
QSurfaceFormat::setDefaultFormat(format);
|
||||
return true;
|
||||
}();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue