mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fix root view pinned bar glitch in comments.
This commit is contained in:
parent
e950130da6
commit
c7b3c95dc6
2 changed files with 20 additions and 10 deletions
|
@ -2259,14 +2259,16 @@ void RepliesWidget::updatePinnedVisibility() {
|
||||||
void RepliesWidget::setPinnedVisibility(bool shown) {
|
void RepliesWidget::setPinnedVisibility(bool shown) {
|
||||||
if (animatingShow()) {
|
if (animatingShow()) {
|
||||||
return;
|
return;
|
||||||
} else if (!_topic && !_rootViewInited) {
|
} else if (!_topic) {
|
||||||
const auto height = shown ? st::historyReplyHeight : 0;
|
if (!_rootViewInitScheduled) {
|
||||||
if (const auto delta = height - _rootViewHeight) {
|
const auto height = shown ? st::historyReplyHeight : 0;
|
||||||
_rootViewHeight = height;
|
if (const auto delta = height - _rootViewHeight) {
|
||||||
if (_scroll->scrollTop() == _scroll->scrollTopMax()) {
|
_rootViewHeight = height;
|
||||||
setGeometryWithTopMoved(geometry(), delta);
|
if (_scroll->scrollTop() == _scroll->scrollTopMax()) {
|
||||||
} else {
|
setGeometryWithTopMoved(geometry(), delta);
|
||||||
updateControlsGeometry();
|
} else {
|
||||||
|
updateControlsGeometry();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (shown) {
|
if (shown) {
|
||||||
|
@ -2275,8 +2277,15 @@ void RepliesWidget::setPinnedVisibility(bool shown) {
|
||||||
_rootView->hide();
|
_rootView->hide();
|
||||||
}
|
}
|
||||||
_rootVisible = shown;
|
_rootVisible = shown;
|
||||||
_rootView->finishAnimating();
|
if (!_rootViewInited) {
|
||||||
_rootViewInited = true;
|
_rootView->finishAnimating();
|
||||||
|
if (!_rootViewInitScheduled) {
|
||||||
|
_rootViewInitScheduled = true;
|
||||||
|
InvokeQueued(this, [=] {
|
||||||
|
_rootViewInited = true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
_rootVisible = shown;
|
_rootVisible = shown;
|
||||||
}
|
}
|
||||||
|
|
|
@ -340,6 +340,7 @@ private:
|
||||||
std::unique_ptr<Ui::PinnedBar> _rootView;
|
std::unique_ptr<Ui::PinnedBar> _rootView;
|
||||||
int _rootViewHeight = 0;
|
int _rootViewHeight = 0;
|
||||||
bool _rootViewInited = false;
|
bool _rootViewInited = false;
|
||||||
|
bool _rootViewInitScheduled = false;
|
||||||
rpl::variable<bool> _rootVisible = false;
|
rpl::variable<bool> _rootVisible = false;
|
||||||
|
|
||||||
std::unique_ptr<Ui::ScrollArea> _scroll;
|
std::unique_ptr<Ui::ScrollArea> _scroll;
|
||||||
|
|
Loading…
Add table
Reference in a new issue