mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-01 07:05:13 +00:00
Load folder dialogs while scrolling.
This commit is contained in:
@@ -36,6 +36,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||||||
#include "data/data_channel.h"
|
#include "data/data_channel.h"
|
||||||
#include "data/data_chat.h"
|
#include "data/data_chat.h"
|
||||||
#include "data/data_user.h"
|
#include "data/data_user.h"
|
||||||
|
#include "data/data_folder.h"
|
||||||
#include "styles/style_dialogs.h"
|
#include "styles/style_dialogs.h"
|
||||||
#include "styles/style_history.h"
|
#include "styles/style_history.h"
|
||||||
#include "styles/style_window.h"
|
#include "styles/style_window.h"
|
||||||
@@ -1055,12 +1056,20 @@ void DialogsWidget::dropEvent(QDropEvent *e) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void DialogsWidget::onListScroll() {
|
void DialogsWidget::onListScroll() {
|
||||||
auto scrollTop = _scroll->scrollTop();
|
const auto scrollTop = _scroll->scrollTop();
|
||||||
_inner->setVisibleTopBottom(scrollTop, scrollTop + _scroll->height());
|
_inner->setVisibleTopBottom(scrollTop, scrollTop + _scroll->height());
|
||||||
updateScrollUpVisibility();
|
updateScrollUpVisibility();
|
||||||
|
|
||||||
// Fix button rendering glitch, Qt bug with WA_OpaquePaintEvent widgets.
|
// Fix button rendering glitch, Qt bug with WA_OpaquePaintEvent widgets.
|
||||||
_scrollToTop->update();
|
_scrollToTop->update();
|
||||||
|
|
||||||
|
if (const auto folder = _inner->shownFolder()) {
|
||||||
|
if (!folder->chatsListLoaded()
|
||||||
|
&& (scrollTop + height() * PreloadHeightsCount
|
||||||
|
>= _scroll->scrollTopMax())) {
|
||||||
|
session().api().requestFolderDialogs(folder->id());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogsWidget::applyFilterUpdate(bool force) {
|
void DialogsWidget::applyFilterUpdate(bool force) {
|
||||||
|
Reference in New Issue
Block a user