diff --git a/Telegram/SourceFiles/info/info_top_bar.cpp b/Telegram/SourceFiles/info/info_top_bar.cpp index f89dceea3c..7f8d402443 100644 --- a/Telegram/SourceFiles/info/info_top_bar.cpp +++ b/Telegram/SourceFiles/info/info_top_bar.cpp @@ -393,10 +393,17 @@ void TopBar::updateDefaultControlsGeometry(int newWidth) { const auto y = _subtitle ? _st.titleWithSubtitlePosition.y() : _st.titlePosition.y(); + const auto available = std::max(newWidth - right - x, 0); + _title->entity()->resizeToWidth(available); _title->moveToLeft(x, y, newWidth); if (_subtitle) { + const auto subtitleX = _back + ? _st.back.width + : _st.subtitlePosition.x(); + _subtitle->entity()->resizeToWidth( + std::max(newWidth - right - subtitleX, 0)); _subtitle->moveToLeft( - _back ? _st.back.width : _st.subtitlePosition.x(), + subtitleX, _st.subtitlePosition.y(), newWidth); }