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() {
|
void ChatWidget::updateControlsGeometry() {
|
||||||
const auto contentWidth = width();
|
const auto contentWidth = width();
|
||||||
|
|
||||||
const auto newScrollTop = _scroll->isHidden()
|
const auto newScrollDelta = _scroll->isHidden()
|
||||||
? std::nullopt
|
? std::nullopt
|
||||||
: _scroll->scrollTop()
|
: _scroll->scrollTop()
|
||||||
? base::make_optional(_scroll->scrollTop()
|
? base::make_optional(topDelta() + _scrollTopDelta)
|
||||||
+ topDelta()
|
|
||||||
+ _scrollTopDelta)
|
|
||||||
: 0;
|
: 0;
|
||||||
_topBar->resizeToWidth(contentWidth);
|
_topBar->resizeToWidth(contentWidth);
|
||||||
_topBarShadow->resize(contentWidth, st::lineWidth);
|
_topBarShadow->resize(contentWidth, st::lineWidth);
|
||||||
|
@ -2726,6 +2724,9 @@ void ChatWidget::updateControlsGeometry() {
|
||||||
}
|
}
|
||||||
_scroll->move(tabsLeftSkip, top);
|
_scroll->move(tabsLeftSkip, top);
|
||||||
if (!_scroll->isHidden()) {
|
if (!_scroll->isHidden()) {
|
||||||
|
const auto newScrollTop = (newScrollDelta && _scroll->scrollTop())
|
||||||
|
? (_scroll->scrollTop() + *newScrollDelta)
|
||||||
|
: std::optional<int>();
|
||||||
if (newScrollTop) {
|
if (newScrollTop) {
|
||||||
_scroll->scrollToY(*newScrollTop);
|
_scroll->scrollToY(*newScrollTop);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue