diff --git a/Telegram/SourceFiles/iv/iv_controller.cpp b/Telegram/SourceFiles/iv/iv_controller.cpp index cc9d727fe..3b30dc6db 100644 --- a/Telegram/SourceFiles/iv/iv_controller.cpp +++ b/Telegram/SourceFiles/iv/iv_controller.cpp @@ -221,7 +221,7 @@ Controller::~Controller() { void Controller::updateTitleGeometry(int newWidth) const { _subtitleWrap->setGeometry( 0, - st::windowTitleHeight, + 0, newWidth, st::ivSubtitleHeight); _subtitleWrap->paintRequest() | rpl::start_with_next([=](QRect clip) { @@ -241,7 +241,7 @@ void Controller::updateTitleGeometry(int newWidth) const { } void Controller::initControls() { - _subtitleWrap = std::make_unique(_window.get()); + _subtitleWrap = std::make_unique(_window->body().get()); _subtitleText = _index.value() | rpl::filter( rpl::mappers::_1 >= 0 ) | rpl::map([=](int index) { @@ -275,7 +275,7 @@ void Controller::initControls() { _back->toggledValue( ) | rpl::start_with_next([=](bool toggled) { _subtitleLeft.start( - [=] { updateTitleGeometry(_window->width()); }, + [=] { updateTitleGeometry(_window->body()->width()); }, toggled ? 0. : 1., toggled ? 1. : 0., st::fadeWrapDuration); @@ -353,7 +353,7 @@ void Controller::createWindow() { initControls(); - window->widthValue() | rpl::start_with_next([=](int width) { + window->body()->widthValue() | rpl::start_with_next([=](int width) { updateTitleGeometry(width); }, _subtitle->lifetime()); @@ -366,13 +366,13 @@ void Controller::createWindow() { _delegate->ivSaveGeometry(window); }, window->lifetime()); - _container = Ui::CreateChild(window->window()); + _container = Ui::CreateChild(window->body().get()); rpl::combine( - window->sizeValue(), + window->body()->sizeValue(), _subtitleWrap->heightValue() ) | rpl::start_with_next([=](QSize size, int title) { _container->setGeometry(QRect(QPoint(), size).marginsRemoved( - { 0, title + st::windowTitleHeight, 0, 0 })); + { 0, title, 0, 0 })); }, _container->lifetime()); _container->paintRequest() | rpl::start_with_next([=](QRect clip) { @@ -807,11 +807,10 @@ void Controller::showShareMenu() { } _shareWrap = std::make_unique(_shareHidesContent - ? _window->window() + ? _window->body().get() : nullptr); - const auto margins = QMargins(0, st::windowTitleHeight, 0, 0); if (!_shareHidesContent) { - _shareWrap->setGeometry(_window->geometry().marginsRemoved(margins)); + _shareWrap->setGeometry(_window->body()->rect()); _shareWrap->setWindowFlag(Qt::FramelessWindowHint); _shareWrap->setAttribute(Qt::WA_TranslucentBackground); _shareWrap->setAttribute(Qt::WA_NoSystemBackground); @@ -819,14 +818,14 @@ void Controller::showShareMenu() { _shareContainer.reset(QWidget::createWindowContainer( _shareWrap->windowHandle(), - _window.get(), + _window->body().get(), Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint)); } - _window->sizeValue() | rpl::start_with_next([=](QSize size) { + _window->body()->sizeValue() | rpl::start_with_next([=](QSize size) { const auto widget = _shareHidesContent ? _shareWrap.get() : _shareContainer.get(); - widget->setGeometry(QRect(QPoint(), size).marginsRemoved(margins)); + widget->setGeometry(QRect(QPoint(), size)); }, _shareWrap->lifetime()); auto result = _showShareBox({