Fix radiobutton list boxes dimensions.

Closes #3655
This commit is contained in:
John Preston 2017-07-12 14:05:29 +03:00
parent 56cb5ac9c6
commit 7b4393ba48
3 changed files with 3 additions and 4 deletions

View File

@ -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) {

View File

@ -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() {

View File

@ -33,7 +33,7 @@ void SelfDestructionBox::prepare() {
auto fake = object_ptr<Ui::FlatLabel>(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();