mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-02 07:35:12 +00:00
Present window's devicePixelRatio in the UI
It's a more valid value when Qt's rater downscaling is in effect Also round it
This commit is contained in:
@@ -474,8 +474,9 @@ void SetupInterfaceScale(
|
|||||||
if constexpr (Platform::IsMac()) {
|
if constexpr (Platform::IsMac()) {
|
||||||
return QString::number(scale) + '%';
|
return QString::number(scale) + '%';
|
||||||
} else {
|
} else {
|
||||||
const auto ratio = window->widget()->devicePixelRatioF();
|
const auto handle = window->widget()->windowHandle();
|
||||||
return QString::number(int(scale * ratio)) + '%';
|
const auto ratio = handle->devicePixelRatio();
|
||||||
|
return QString::number(base::SafeRound(scale * ratio)) + '%';
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
label->setText(labelText(cEvalScale(scale)));
|
label->setText(labelText(cEvalScale(scale)));
|
||||||
|
Reference in New Issue
Block a user