Keep fetching history until the scrollbar gets activated

This commit is contained in:
Konstantinos Sideris 2017-08-05 15:59:24 +03:00
parent 748eb949a7
commit af0f22fc91
5 changed files with 28 additions and 10 deletions

View file

@ -56,13 +56,14 @@ public slots:
protected:
void mousePressEvent(QMouseEvent *event) override;
void paintEvent(QPaintEvent *event) override;
void resizeEvent(QResizeEvent *event) override;
void contextMenuEvent(QContextMenuEvent *event) override;
private:
QString notificationText();
const int Padding = 7;
const int IconSize = 46;
const int IconSize = 48;
RippleOverlay *ripple_overlay_;

View file

@ -73,12 +73,12 @@ public:
int addEvents(const Timeline &timeline);
void addUserTextMessage(const QString &msg, int txn_id);
void updatePendingMessage(int txn_id, QString event_id);
void fetchHistory();
void scrollDown();
public slots:
void sliderRangeChanged(int min, int max);
void sliderMoved(int position);
void fetchHistory();
// Add old events at the top of the timeline.
void addBackwardsEvents(const QString &room_id, const RoomMessages &msgs);
@ -118,6 +118,8 @@ private:
const int SCROLL_BAR_GAP = 400;
QTimer *paginationTimer_;
int scroll_height_ = 0;
int previous_max_height_ = 0;