From 2f7c1cca7803ed3ef20d8da4261d8d77aa04f9a9 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 4 Feb 2015 10:59:20 +0300 Subject: [PATCH] fixed bg cache for tiled background, linux version background supported --- Telegram/SourceFiles/app.cpp | 2 +- Telegram/SourceFiles/mainwidget.cpp | 2 +- Telegram/Telegram.pro | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index 330a60f93..9e3e5d416 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -2272,7 +2272,7 @@ namespace App { componentsScroll[maxtomin[1]] = qMin(uint64(float64(componentsScroll[maxtomin[1]]) * maxScroll / float64(componentsScroll[maxtomin[0]])), 0xFFULL); componentsScroll[maxtomin[0]] = qMin(maxScroll, 0xFFULL); - if (max > qRound(0.2 * 0xFF)) { // brightness greater than 20% + if (max > uint64(qRound(0.2 * 0xFF))) { // brightness greater than 20% max -= qRound(0.2 * 0xFF); } else { max = 0; diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 0b5e4cdfc..019d05b80 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -720,7 +720,7 @@ void MainWidget::onCacheBackground() { const QPixmap &bg(*cChatBackground()); if (cTileBackground()) { QImage result(_willCacheFor.width() * cIntRetinaFactor(), _willCacheFor.height() * cIntRetinaFactor(), QImage::Format_RGB32); - result.setDevicePixelRatio(2); + result.setDevicePixelRatio(cRetinaFactor()); { QPainter p(&result); int left = 0, top = 0, right = _willCacheFor.width(), bottom = _willCacheFor.height(); diff --git a/Telegram/Telegram.pro b/Telegram/Telegram.pro index c490ddc41..b839fa013 100644 --- a/Telegram/Telegram.pro +++ b/Telegram/Telegram.pro @@ -137,6 +137,7 @@ SOURCES += \ ./SourceFiles/boxes/aboutbox.cpp \ ./SourceFiles/boxes/addcontactbox.cpp \ ./SourceFiles/boxes/addparticipantbox.cpp \ + ./SourceFiles/boxes/backgroundbox.cpp \ ./SourceFiles/boxes/confirmbox.cpp \ ./SourceFiles/boxes/connectionbox.cpp \ ./SourceFiles/boxes/contactsbox.cpp \ @@ -221,6 +222,7 @@ HEADERS += \ ./SourceFiles/boxes/aboutbox.h \ ./SourceFiles/boxes/addcontactbox.h \ ./SourceFiles/boxes/addparticipantbox.h \ + ./SourceFiles/boxes/backgroundbox.h \ ./SourceFiles/boxes/confirmbox.h \ ./SourceFiles/boxes/connectionbox.h \ ./SourceFiles/boxes/contactsbox.h \