mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-07-27 07:52:57 +02:00
Improve opening ChatWidget at the end.
This commit is contained in:
parent
d156de05a5
commit
41ed487d5e
1 changed files with 5 additions and 4 deletions
|
@ -2663,12 +2663,10 @@ void ChatWidget::recountChatWidth() {
|
|||
void ChatWidget::updateControlsGeometry() {
|
||||
const auto contentWidth = width();
|
||||
|
||||
const auto newScrollTop = _scroll->isHidden()
|
||||
const auto newScrollDelta = _scroll->isHidden()
|
||||
? std::nullopt
|
||||
: _scroll->scrollTop()
|
||||
? base::make_optional(_scroll->scrollTop()
|
||||
+ topDelta()
|
||||
+ _scrollTopDelta)
|
||||
? base::make_optional(topDelta() + _scrollTopDelta)
|
||||
: 0;
|
||||
_topBar->resizeToWidth(contentWidth);
|
||||
_topBarShadow->resize(contentWidth, st::lineWidth);
|
||||
|
@ -2726,6 +2724,9 @@ void ChatWidget::updateControlsGeometry() {
|
|||
}
|
||||
_scroll->move(tabsLeftSkip, top);
|
||||
if (!_scroll->isHidden()) {
|
||||
const auto newScrollTop = (newScrollDelta && _scroll->scrollTop())
|
||||
? (_scroll->scrollTop() + *newScrollDelta)
|
||||
: std::optional<int>();
|
||||
if (newScrollTop) {
|
||||
_scroll->scrollToY(*newScrollTop);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue