2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Allow using any interface scale between 100%-300%.

This commit is contained in:
John Preston
2018-10-15 14:44:48 +03:00
parent 149639a53d
commit 19a9a990b6
30 changed files with 207 additions and 242 deletions

View File

@@ -1455,8 +1455,8 @@ void MediaView::displayPhoto(not_null<PhotoData*> photo, HistoryItem *item) {
_full = -1;
_current = QPixmap();
_down = OverNone;
_w = convertScale(photo->full->width());
_h = convertScale(photo->full->height());
_w = ConvertScale(photo->full->width());
_h = ConvertScale(photo->full->height());
if (isHidden()) {
moveToScreen();
}
@@ -1600,11 +1600,11 @@ void MediaView::displayDocument(DocumentData *doc, HistoryItem *item) { // empty
updateThemePreviewGeometry();
} else if (!_current.isNull()) {
_current.setDevicePixelRatio(cRetinaFactor());
_w = convertScale(_current.width());
_h = convertScale(_current.height());
_w = ConvertScale(_current.width());
_h = ConvertScale(_current.height());
} else {
_w = convertScale(_gif->width());
_h = convertScale(_gif->height());
_w = ConvertScale(_gif->width());
_h = ConvertScale(_gif->height());
}
if (isHidden()) {
moveToScreen();
@@ -2437,8 +2437,8 @@ void MediaView::setZoomLevel(int newZoom) {
if (_zoom == newZoom) return;
float64 nx, ny, z = (_zoom == ZoomToScreenLevel) ? _zoomToScreen : _zoom;
_w = gifShown() ? convertScale(_gif->width()) : (convertScale(_current.width()) / cIntRetinaFactor());
_h = gifShown() ? convertScale(_gif->height()) : (convertScale(_current.height()) / cIntRetinaFactor());
_w = gifShown() ? ConvertScale(_gif->width()) : (ConvertScale(_current.width()) / cIntRetinaFactor());
_h = gifShown() ? ConvertScale(_gif->height()) : (ConvertScale(_current.height()) / cIntRetinaFactor());
if (z >= 0) {
nx = (_x - width() / 2.) / (z + 1);
ny = (_y - height() / 2.) / (z + 1);