void ManagePeerBox::setupContent() { auto content = Ui::CreateChild<Ui::VerticalLayout>(this); FillManageBox(controller(), _channel, content); widthValue( ) | rpl::start_with_next([=](int width) { content->resizeToWidth(width); }, content->lifetime()); content->heightValue( ) | rpl::start_with_next([=](int height) { setDimensions(st::boxWidth, height); }, content->lifetime()); }
void Panel::showCriticalError(const QString &error) { auto container = base::make_unique_q<Ui::PaddingWrap<Ui::FlatLabel>>( _widget.get(), object_ptr<Ui::FlatLabel>( _widget.get(), error, Ui::FlatLabel::InitType::Simple, st::passportErrorLabel), style::margins(0, st::passportPanelSize.height() / 3, 0, 0)); container->widthValue( ) | rpl::start_with_next([label = container->entity()](int width) { label->resize(width, label->height()); }, container->lifetime()); _widget->showInner(std::move(container)); setBackAllowed(false); }