From 7b4393ba482543d3723125cdbe01e989adf78a3c Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 12 Jul 2017 14:05:29 +0300 Subject: [PATCH] Fix radiobutton list boxes dimensions. Closes #3655 --- Telegram/SourceFiles/boxes/autolock_box.cpp | 2 +- Telegram/SourceFiles/boxes/language_box.cpp | 3 +-- Telegram/SourceFiles/boxes/self_destruction_box.cpp | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Telegram/SourceFiles/boxes/autolock_box.cpp b/Telegram/SourceFiles/boxes/autolock_box.cpp index 92ef5046c..ab30e51c1 100644 --- a/Telegram/SourceFiles/boxes/autolock_box.cpp +++ b/Telegram/SourceFiles/boxes/autolock_box.cpp @@ -44,7 +44,7 @@ void AutoLockBox::prepare() { } group->setChangedCallback([this](int value) { durationChanged(value); }); - setDimensions(st::langsWidth, st::boxOptionListPadding.top() + count * st::langsButton.height + (count - 1) * st::boxOptionListSkip + st::boxOptionListPadding.bottom() + st::boxPadding.bottom()); + setDimensions(st::langsWidth, st::boxOptionListPadding.top() + count * _options.back()->heightNoMargins() + (count - 1) * st::boxOptionListSkip + st::boxOptionListPadding.bottom() + st::boxPadding.bottom()); } void AutoLockBox::durationChanged(int seconds) { diff --git a/Telegram/SourceFiles/boxes/language_box.cpp b/Telegram/SourceFiles/boxes/language_box.cpp index 577fc3444..7a084ed26 100644 --- a/Telegram/SourceFiles/boxes/language_box.cpp +++ b/Telegram/SourceFiles/boxes/language_box.cpp @@ -131,8 +131,7 @@ void LanguageBox::refresh() { refreshLanguages(); _inner->refresh(); - auto maxHeight = st::boxOptionListPadding.top() + st::langsButton.margin.top() + _languages.size() * (st::langsButton.height + st::boxOptionListSkip) - st::boxOptionListSkip + st::boxOptionListPadding.bottom() + st::langsButton.margin.bottom() + st::boxPadding.bottom(); - setDimensions(st::langsWidth, qMin(maxHeight, st::boxMaxListHeight)); + setDimensions(st::langsWidth, qMin(_inner->height(), st::boxMaxListHeight)); } void LanguageBox::refreshLanguages() { diff --git a/Telegram/SourceFiles/boxes/self_destruction_box.cpp b/Telegram/SourceFiles/boxes/self_destruction_box.cpp index afc0d9d3c..ebd03b616 100644 --- a/Telegram/SourceFiles/boxes/self_destruction_box.cpp +++ b/Telegram/SourceFiles/boxes/self_destruction_box.cpp @@ -33,7 +33,7 @@ void SelfDestructionBox::prepare() { auto fake = object_ptr(this, lang(lng_self_destruct_description), Ui::FlatLabel::InitType::Simple, st::boxLabel); auto boxHeight = st::boxOptionListPadding.top() + fake->height() + st::boxMediumSkip - + _ttlValues.size() * (st::langsButton.height + st::boxOptionListSkip) - st::boxOptionListSkip + + _ttlValues.size() * (st::defaultRadio.diameter + st::boxOptionListSkip) - st::boxOptionListSkip + st::boxOptionListPadding.bottom() + st::boxPadding.bottom(); fake.destroy();