2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-05 09:05:14 +00:00

links preview done

This commit is contained in:
John Preston
2015-04-04 23:01:34 +03:00
parent 868d5f60f3
commit f3bb155b0a
67 changed files with 2712 additions and 1416 deletions

View File

@@ -1441,7 +1441,7 @@ void OverviewInner::itemRemoved(HistoryItem *item) {
parentWidget()->update();
}
void OverviewInner::itemResized(HistoryItem *item) {
void OverviewInner::itemResized(HistoryItem *item, bool scrollToIt) {
if (_type != OverviewPhotos) {
HistoryMedia *media = item ? item->getMedia(true) : 0;
if (!media) return;
@@ -1462,11 +1462,13 @@ void OverviewInner::itemResized(HistoryItem *item) {
_height = _items[l - 1].y;
_addToY = (_height < _minHeight) ? (_minHeight - _height) : 0;
resize(width(), _minHeight > _height ? _minHeight : _height);
if (_addToY + _height - from > _scroll->scrollTop() + _scroll->height()) {
_scroll->scrollToY(_addToY + _height - from - _scroll->height());
}
if (_addToY + _height - _items[i].y < _scroll->scrollTop()) {
_scroll->scrollToY(_addToY + _height - _items[i].y);
if (scrollToIt) {
if (_addToY + _height - from > _scroll->scrollTop() + _scroll->height()) {
_scroll->scrollToY(_addToY + _height - from - _scroll->height());
}
if (_addToY + _height - _items[i].y < _scroll->scrollTop()) {
_scroll->scrollToY(_addToY + _height - _items[i].y);
}
}
parentWidget()->update();
}
@@ -1780,9 +1782,9 @@ void OverviewWidget::itemRemoved(HistoryItem *row) {
}
}
void OverviewWidget::itemResized(HistoryItem *row) {
void OverviewWidget::itemResized(HistoryItem *row, bool scrollToIt) {
if (!row || row->history()->peer == peer()) {
_inner.itemResized(row);
_inner.itemResized(row, scrollToIt);
}
}