mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Add interface scale (100%..150%) for Retina.
Fixes #69, fixes #3126, fixes #3789.
This commit is contained in:
@@ -291,8 +291,8 @@ void ClearUniversalChecked() {
|
||||
void Init() {
|
||||
internal::Init();
|
||||
|
||||
SizeNormal = ConvertScale(18) * cIntRetinaFactor();
|
||||
SizeLarge = int(ConvertScale(18 * 4 / 3.)) * cIntRetinaFactor();
|
||||
SizeNormal = ConvertScale(18, cScale() * cIntRetinaFactor());
|
||||
SizeLarge = int(ConvertScale(18 * 4 / 3., cScale() * cIntRetinaFactor()));
|
||||
const auto count = internal::FullCount();
|
||||
const auto persprite = kImagesPerRow * kImageRowsPerSprite;
|
||||
SpritesCount = (count / persprite) + ((count % persprite) ? 1 : 0);
|
||||
@@ -553,9 +553,7 @@ const QPixmap &SinglePixmap(EmojiPtr emoji, int fontHeight) {
|
||||
SizeNormal + st::emojiPadding * cIntRetinaFactor() * 2,
|
||||
fontHeight * cIntRetinaFactor(),
|
||||
QImage::Format_ARGB32_Premultiplied);
|
||||
if (cRetina()) {
|
||||
image.setDevicePixelRatio(cRetinaFactor());
|
||||
}
|
||||
image.setDevicePixelRatio(cRetinaFactor());
|
||||
image.fill(Qt::transparent);
|
||||
{
|
||||
QPainter p(&image);
|
||||
@@ -643,9 +641,7 @@ void Instance::generateCache() {
|
||||
|
||||
void Instance::pushSprite(QImage &&data) {
|
||||
_sprites.push_back(App::pixmapFromImageInPlace(std::move(data)));
|
||||
if (cRetina()) {
|
||||
_sprites.back().setDevicePixelRatio(cRetinaFactor());
|
||||
}
|
||||
_sprites.back().setDevicePixelRatio(cRetinaFactor());
|
||||
}
|
||||
|
||||
} // namespace Emoji
|
||||
|
Reference in New Issue
Block a user