2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

fixed gif animations for wide gifs

This commit is contained in:
John Preston
2014-10-10 17:47:39 +04:00
parent 09e2fbaa6b
commit e1adf54b36
5 changed files with 26 additions and 170 deletions

View File

@@ -463,16 +463,18 @@ void HistoryList::dragActionCancel() {
}
void HistoryList::itemRemoved(HistoryItem *item) {
if (_dragItem == item) {
dragActionCancel();
}
SelectedItems::iterator i = _selected.find(item);
if (i != _selected.cend()) {
_selected.erase(i);
historyWidget->updateTopBarSelection();
}
if (_dragAction == NoDrag) return;
if (_dragItem == item) {
dragActionCancel();
}
onUpdateSelected();
if (_dragSelFrom == item) _dragSelFrom = 0;
@@ -836,24 +838,6 @@ void HistoryList::copyContextText() {
}
}
bool HistoryList::getPhotoCoords(PhotoData *photo, int32 &x, int32 &y, int32 &w) const {
HistoryItem *hoveredItem = App::hoveredLinkItem();
if (hoveredItem && hoveredItem->getPhotoCoords(photo, x, y, w)) {
y += height() - hist->height - st::historyPadding + hoveredItem->block()->y + hoveredItem->y;
return true;
}
return false;
}
bool HistoryList::getVideoCoords(VideoData *video, int32 &x, int32 &y, int32 &w) const {
HistoryItem *hoveredItem = App::hoveredItem();
if (hoveredItem && hoveredItem->getVideoCoords(video, x, y, w)) {
y += height() - hist->height - st::historyPadding + hoveredItem->block()->y + hoveredItem->y;
return true;
}
return false;
}
void HistoryList::resizeEvent(QResizeEvent *e) {
onUpdateSelected();
}
@@ -3323,24 +3307,6 @@ void HistoryWidget::paintEvent(QPaintEvent *e) {
}
}
bool HistoryWidget::getPhotoCoords(PhotoData *photo, int32 &x, int32 &y, int32 &w) const {
if (_list && _list->getPhotoCoords(photo, x, y, w)) {
x += _list->x();
y += _list->y();
return true;
}
return false;
}
bool HistoryWidget::getVideoCoords(VideoData *video, int32 &x, int32 &y, int32 &w) const {
if (_list && _list->getVideoCoords(video, x, y, w)) {
x += _list->x();
y += _list->y();
return true;
}
return false;
}
QRect HistoryWidget::historyRect() const {
return _scroll.geometry();
}