mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-30 22:25:12 +00:00
Fix root view pinned bar glitch in comments.
This commit is contained in:
@@ -2259,14 +2259,16 @@ void RepliesWidget::updatePinnedVisibility() {
|
||||
void RepliesWidget::setPinnedVisibility(bool shown) {
|
||||
if (animatingShow()) {
|
||||
return;
|
||||
} else if (!_topic && !_rootViewInited) {
|
||||
const auto height = shown ? st::historyReplyHeight : 0;
|
||||
if (const auto delta = height - _rootViewHeight) {
|
||||
_rootViewHeight = height;
|
||||
if (_scroll->scrollTop() == _scroll->scrollTopMax()) {
|
||||
setGeometryWithTopMoved(geometry(), delta);
|
||||
} else {
|
||||
updateControlsGeometry();
|
||||
} else if (!_topic) {
|
||||
if (!_rootViewInitScheduled) {
|
||||
const auto height = shown ? st::historyReplyHeight : 0;
|
||||
if (const auto delta = height - _rootViewHeight) {
|
||||
_rootViewHeight = height;
|
||||
if (_scroll->scrollTop() == _scroll->scrollTopMax()) {
|
||||
setGeometryWithTopMoved(geometry(), delta);
|
||||
} else {
|
||||
updateControlsGeometry();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (shown) {
|
||||
@@ -2275,8 +2277,15 @@ void RepliesWidget::setPinnedVisibility(bool shown) {
|
||||
_rootView->hide();
|
||||
}
|
||||
_rootVisible = shown;
|
||||
_rootView->finishAnimating();
|
||||
_rootViewInited = true;
|
||||
if (!_rootViewInited) {
|
||||
_rootView->finishAnimating();
|
||||
if (!_rootViewInitScheduled) {
|
||||
_rootViewInitScheduled = true;
|
||||
InvokeQueued(this, [=] {
|
||||
_rootViewInited = true;
|
||||
});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
_rootVisible = shown;
|
||||
}
|
||||
|
@@ -340,6 +340,7 @@ private:
|
||||
std::unique_ptr<Ui::PinnedBar> _rootView;
|
||||
int _rootViewHeight = 0;
|
||||
bool _rootViewInited = false;
|
||||
bool _rootViewInitScheduled = false;
|
||||
rpl::variable<bool> _rootVisible = false;
|
||||
|
||||
std::unique_ptr<Ui::ScrollArea> _scroll;
|
||||
|
Reference in New Issue
Block a user