From 03aeaadd5bede31a73734e4d5996a5914f2ac9f1 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 24 May 2017 13:17:29 +0300 Subject: [PATCH] Update floating player position. --- Telegram/SourceFiles/dialogswidget.cpp | 4 ++++ Telegram/SourceFiles/historywidget.cpp | 2 ++ Telegram/SourceFiles/mainwidget.cpp | 1 + 3 files changed, 7 insertions(+) diff --git a/Telegram/SourceFiles/dialogswidget.cpp b/Telegram/SourceFiles/dialogswidget.cpp index ee4fbd9f79..b8d68e31e6 100644 --- a/Telegram/SourceFiles/dialogswidget.cpp +++ b/Telegram/SourceFiles/dialogswidget.cpp @@ -3094,7 +3094,11 @@ void DialogsWidget::updateControlsGeometry() { _updateTelegram->setGeometry(0, height() - updateHeight, width(), updateHeight); scrollHeight -= updateHeight; } + auto wasScrollHeight = _scroll->height(); _scroll->setGeometry(0, scrollTop, width(), scrollHeight); + if (scrollHeight != wasScrollHeight) { + controller()->floatPlayerAreaUpdated().notify(true); + } if (addToScroll) { _scroll->scrollToY(newScrollTop); } else { diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 8fe32c02a5..a7861431f4 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -4789,6 +4789,8 @@ void HistoryWidget::updateListSize(bool initial, bool loadedDown, const ScrollCh _fieldAutocomplete->setBoundings(_scroll->geometry()); _historyDown->moveToRight(st::historyToDownPosition.x(), _scroll->y() + _scroll->height() - _historyDown->height() - st::historyToDownPosition.y()); + + controller()->floatPlayerAreaUpdated().notify(true); } _list->recountHeight(); diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 85c7394dca..d4dbf79efe 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -292,6 +292,7 @@ void MainWidget::checkFloatPlayerVisibility() { instance->hiddenByHistory = true; } toggleFloatPlayer(instance); + updateFloatPlayerPosition(instance); } void MainWidget::updateFloatPlayerPosition(Float *instance) {