2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 22:46:10 +00:00

Fix in-window preview (Wayland / noCompositing).

This commit is contained in:
John Preston
2023-01-06 20:00:58 +04:00
parent ff331c040a
commit 43a830f0af
2 changed files with 65 additions and 29 deletions

View File

@@ -523,12 +523,11 @@ void SetupInterfaceScale(
if (values[i] <= scale
&& (i + 1 == valuesCount || values[i + 1] > scale)) {
const auto x = (slider->width() * i) / (valuesCount - 1);
const auto globalX = slider->mapToGlobal(QPoint(x, 0)).x();
togglePreview(show, scale, globalX);
togglePreview(show, scale, x);
return;
}
}
togglePreview(show, scale, QCursor::pos().x());
togglePreview(show, scale, slider->width() / 2);
};
const auto toggleHidePreview = [=] {
togglePreview(ScalePreviewShow::Hide, 0, 0);