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

pausing gifs when mediaview is opened, improved photos handling - download on click if autoload disabled

This commit is contained in:
John Preston
2015-12-25 16:09:14 +03:00
parent edb2a9d5f6
commit a5622cfe3b
20 changed files with 418 additions and 349 deletions

View File

@@ -320,9 +320,9 @@ int32 LayoutOverviewPhoto::resizeGetHeight(int32 width) {
}
void LayoutOverviewPhoto::paint(Painter &p, const QRect &clip, uint32 selection, const PaintContext *context) const {
bool good = _data->full->loaded();
bool good = _data->loaded();
if (!good) {
_data->medium->load(false, false);
_data->medium->automaticLoad(_parent);
good = _data->medium->loaded();
}
if ((good && !_goodLoaded) || _pix.width() != _width * cIntRetinaFactor()) {
@@ -330,7 +330,7 @@ void LayoutOverviewPhoto::paint(Painter &p, const QRect &clip, uint32 selection,
int32 size = _width * cIntRetinaFactor();
if (_goodLoaded || _data->thumb->loaded()) {
QImage img = (_data->full->loaded() ? _data->full : (_data->medium->loaded() ? _data->medium : _data->thumb))->pix().toImage();
QImage img = (_data->loaded() ? _data->full : (_data->medium->loaded() ? _data->medium : _data->thumb))->pix().toImage();
if (!_goodLoaded) {
img = imageBlur(img);
}
@@ -1095,7 +1095,7 @@ LayoutOverviewLink::LayoutOverviewLink(HistoryMedia *media, HistoryItem *parent)
}
int32 tw = 0, th = 0;
if (_page && _page->photo) {
if (!_page->photo->full->loaded()) _page->photo->thumb->load(false, false);
if (!_page->photo->loaded()) _page->photo->thumb->load(false, false);
tw = convertScale(_page->photo->thumb->width());
th = convertScale(_page->photo->thumb->height());
@@ -1176,7 +1176,7 @@ void LayoutOverviewLink::paint(Painter &p, const QRect &clip, uint32 selection,
if (clip.intersects(rtlrect(0, top, st::dlgPhotoSize, st::dlgPhotoSize, _width))) {
if (_page && _page->photo) {
QPixmap pix;
if (_page->photo->full->loaded()) {
if (_page->photo->loaded()) {
pix = _page->photo->full->pixSingle(_pixw, _pixh, st::dlgPhotoSize, st::dlgPhotoSize);
} else if (_page->photo->medium->loaded()) {
pix = _page->photo->medium->pixSingle(_pixw, _pixh, st::dlgPhotoSize, st::dlgPhotoSize);