Removed skip translation setting when it is disabled.

This commit is contained in:
23rd 2022-11-30 03:26:34 +03:00
parent f8a17bd9c9
commit 11165abc09
1 changed files with 13 additions and 1 deletions

View File

@ -1118,8 +1118,16 @@ void LanguageBox::prepare() {
}, translateEnabled->lifetime());
const auto label = lifetime().make_state<rpl::event_stream<QLocale>>();
const auto translateSkipWrap = topContainer->add(
object_ptr<Ui::SlideWrap<Ui::VerticalLayout>>(
topContainer,
object_ptr<Ui::VerticalLayout>(topContainer)));
translateSkipWrap->toggle(
translateEnabled->toggled(),
anim::type::normal);
translateSkipWrap->toggleOn(translateEnabled->toggledValue());
const auto translateSkip = Settings::AddButtonWithLabel(
topContainer,
translateSkipWrap->entity(),
tr::lng_translate_settings_choose(),
label->events() | rpl::map(Ui::LanguageName),
st::settingsButtonNoIcon);
@ -1177,6 +1185,10 @@ void LanguageBox::prepare() {
accumulate_max(*max, height);
setDimensions(st::boxWidth, qMin(*max, st::boxMaxListHeight));
}, inner->lifetime());
topContainer->heightValue(
) | rpl::start_with_next([=](int height) {
setInnerTopSkip(height);
}, inner->lifetime());
select->setSubmittedCallback([=](Qt::KeyboardModifiers) {
inner->activateBySubmit();