diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index e610734fa..703aa35ef 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -5857,6 +5857,8 @@ void HistoryWidget::ui_repaintHistoryItem(const HistoryItem *item) { } void HistoryWidget::onUpdateHistoryItems() { + if (!_list) return; + uint64 ms = getms(); if (_lastScrolled + 100 <= ms) { _list->update(); diff --git a/Telegram/SourceFiles/layout.cpp b/Telegram/SourceFiles/layout.cpp index 1b6c202b4..7f93461da 100644 --- a/Telegram/SourceFiles/layout.cpp +++ b/Telegram/SourceFiles/layout.cpp @@ -850,9 +850,11 @@ void LayoutOverviewDocument::paint(Painter &p, const QRect &clip, uint32 selecti statustop = st::linksBorder + st::overviewFileStatusTop; datetop = st::linksBorder + st::overviewFileDateTop; - QRect shadow(rtlrect(nameleft, 0, _width - nameleft, st::linksBorder, _width)); - if (clip.intersects(shadow)) { - p.fillRect(clip.intersected(shadow), st::linksBorderFg); + const OverviewPaintContext *pcontext = context->toOverviewPaintContext(); + t_assert(pcontext != 0); + QRect border(rtlrect(nameleft, 0, _width - nameleft, st::linksBorder, _width)); + if (!pcontext->isAfterDate && clip.intersects(border)) { + p.fillRect(clip.intersected(border), st::linksBorderFg); } QRect rthumb(rtlrect(0, st::linksBorder + st::overviewFilePadding.top(), st::overviewFileSize, st::overviewFileSize, _width)); @@ -1274,8 +1276,11 @@ void LayoutOverviewLink::paint(Painter &p, const QRect &clip, uint32 selection, top += st::normalFont->height; } - if (clip.intersects(rtlrect(left, 0, w, st::linksBorder, _width))) { - p.fillRect(clip.intersected(rtlrect(left, 0, w, st::linksBorder, _width)), st::linksBorderFg); + const OverviewPaintContext *pcontext = context->toOverviewPaintContext(); + t_assert(pcontext != 0); + QRect border(rtlrect(left, 0, w, st::linksBorder, _width)); + if (!pcontext->isAfterDate && clip.intersects(border)) { + p.fillRect(clip.intersected(border), st::linksBorderFg); } } diff --git a/Telegram/SourceFiles/layout.h b/Telegram/SourceFiles/layout.h index 21d93c5d2..5b790b3f1 100644 --- a/Telegram/SourceFiles/layout.h +++ b/Telegram/SourceFiles/layout.h @@ -81,6 +81,7 @@ style::color documentSelectedColor(int32 colorIndex); style::sprite documentCorner(int32 colorIndex); RoundCorners documentCorners(int32 colorIndex); +class OverviewPaintContext; class InlinePaintContext; class PaintContext { public: @@ -89,6 +90,10 @@ public: } uint64 ms; bool selecting; + + virtual const OverviewPaintContext *toOverviewPaintContext() const { + return 0; + } virtual const InlinePaintContext *toInlinePaintContext() const { return 0; } @@ -260,6 +265,17 @@ protected: }; +class OverviewPaintContext : public PaintContext { +public: + OverviewPaintContext(uint64 ms, bool selecting) : PaintContext(ms, selecting), isAfterDate(false) { + } + const OverviewPaintContext *toOverviewPaintContext() const { + return this; + } + bool isAfterDate; + +}; + class OverviewItemInfo { public: OverviewItemInfo() : _top(0) { diff --git a/Telegram/SourceFiles/overviewwidget.cpp b/Telegram/SourceFiles/overviewwidget.cpp index d2889f7c6..4f8f6dd03 100644 --- a/Telegram/SourceFiles/overviewwidget.cpp +++ b/Telegram/SourceFiles/overviewwidget.cpp @@ -834,7 +834,7 @@ void OverviewInner::paintEvent(QPaintEvent *e) { p.setClipRect(r); } uint64 ms = getms(); - PaintContext context(ms, _selMode); + OverviewPaintContext context(ms, _selMode); if (_history->overview[_type].isEmpty() && (!_migrated || !_history->overviewLoaded(_type) || _migrated->overview[_type].isEmpty())) { QPoint dogPos((_width - st::msgDogImg.pxWidth()) / 2, ((height() - st::msgDogImg.pxHeight()) * 4) / 9); @@ -887,6 +887,7 @@ void OverviewInner::paintEvent(QPaintEvent *e) { if (_reversed) curY = _height - curY; if (_marginTop + curY >= r.y() + r.height()) break; + context.isAfterDate = (j > 0) ? !_items.at(j - 1)->toLayoutMediaItem() : false; p.translate(0, curY - y); _items.at(i)->paint(p, r.translated(-_rowsLeft, -_marginTop - curY), itemSelectedValue(i), &context); y = curY;