mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Use variables from style namespace instead of hardcoded scale limits
This commit is contained in:
parent
20f946f657
commit
6e89d41d58
1 changed files with 3 additions and 3 deletions
|
@ -244,12 +244,12 @@ void Sandbox::setupScreenScale() {
|
||||||
LOG(("Computed screen scale: %1").arg(screenScale));
|
LOG(("Computed screen scale: %1").arg(screenScale));
|
||||||
if (Platform::IsMac()) {
|
if (Platform::IsMac()) {
|
||||||
// 110% for Retina screens by default.
|
// 110% for Retina screens by default.
|
||||||
cSetScreenScale((useRatio == 2) ? 110 : 100);
|
cSetScreenScale((useRatio == 2) ? 110 : style::kScaleDefault);
|
||||||
} else {
|
} else {
|
||||||
const auto clamped = std::clamp(
|
const auto clamped = std::clamp(
|
||||||
screenScale * useRatio,
|
screenScale * useRatio,
|
||||||
50 * useRatio,
|
style::kScaleMin * useRatio,
|
||||||
300);
|
style::kScaleMax);
|
||||||
cSetScreenScale(int(base::SafeRound(clamped * 1. / useRatio)));
|
cSetScreenScale(int(base::SafeRound(clamped * 1. / useRatio)));
|
||||||
}
|
}
|
||||||
LOG(("DevicePixelRatio: %1").arg(useRatio));
|
LOG(("DevicePixelRatio: %1").arg(useRatio));
|
||||||
|
|
Loading…
Add table
Reference in a new issue