Fix box title dynamic change.

This commit is contained in:
John Preston 2020-06-29 22:24:46 +04:00
parent d6e7aa6f63
commit 566f301636

View file

@ -151,9 +151,13 @@ void BoxLayerWidget::parentResized() {
void BoxLayerWidget::setTitle(rpl::producer<TextWithEntities> title) {
const auto wasTitle = hasTitle();
if (title) {
_title.create(this, std::move(title), st::boxTitle);
_title.create(this, rpl::duplicate(title), st::boxTitle);
_title->show();
updateTitlePosition();
std::move(
title
) | rpl::start_with_next([=] {
updateTitlePosition();
}, _title->lifetime());
} else {
_title.destroy();
}