2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Added '-scale' command-line argument for custom scale.

- Fixed #5272.
 - Fixed #5365.
 - Fixed #6055.
This commit is contained in:
23rd
2019-05-25 13:06:12 +03:00
committed by John Preston
parent 5f97b3bc22
commit 47910b2ae1
3 changed files with 27 additions and 5 deletions

View File

@@ -125,14 +125,24 @@ void SetupInterfaceScale(
object_ptr<Ui::SettingsSlider>(container, st::settingsSlider),
icon ? st::settingsScalePadding : st::settingsBigScalePadding);
static const auto ScaleValues = (cIntRetinaFactor() > 1)
? std::vector<int>{ 100, 110, 120, 130, 140, 150 }
: std::vector<int>{ 100, 125, 150, 200, 250, 300 };
static const auto ScaleValues = [&] {
auto values = (cIntRetinaFactor() > 1)
? std::vector<int>{ 100, 110, 120, 130, 140, 150 }
: std::vector<int>{ 100, 125, 150, 200, 250, 300 };
if (cConfigScale() == kInterfaceScaleAuto) {
return values;
}
if (ranges::find(values, cConfigScale()) == end(values)) {
values.push_back(cConfigScale());
}
return values;
}();
const auto sectionFromScale = [](int scale) {
scale = cEvalScale(scale);
auto result = 0;
for (const auto value : ScaleValues) {
if (scale <= value) {
if (scale == value) {
break;
}
++result;