mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-19 07:37:11 +02:00
Fixed resetting menu scroll after refresh of filter list.
This commit is contained in:
parent
1630ad0804
commit
8ef00dc4ff
1 changed files with 7 additions and 0 deletions
|
@ -166,6 +166,7 @@ void FiltersMenu::refresh() {
|
|||
if (filters->list().empty() || _ignoreRefresh) {
|
||||
return;
|
||||
}
|
||||
const auto oldTop = _scroll.scrollTop();
|
||||
|
||||
if (!_list) {
|
||||
setupList();
|
||||
|
@ -185,6 +186,12 @@ void FiltersMenu::refresh() {
|
|||
_reorder->start();
|
||||
|
||||
_container->resizeToWidth(_outer.width());
|
||||
|
||||
// After the filters are refreshed, the scroll is reset,
|
||||
// so we have to restore it.
|
||||
_scroll.scrollToY(oldTop);
|
||||
const auto i = _filters.find(_activeFilterId);
|
||||
scrollToButton((i != end(_filters)) ? i->second : _all);
|
||||
}
|
||||
|
||||
void FiltersMenu::setupList() {
|
||||
|
|
Loading…
Add table
Reference in a new issue