mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Removed skip translation setting when it is disabled.
This commit is contained in:
parent
f8a17bd9c9
commit
11165abc09
1 changed files with 13 additions and 1 deletions
|
@ -1118,8 +1118,16 @@ void LanguageBox::prepare() {
|
||||||
}, translateEnabled->lifetime());
|
}, translateEnabled->lifetime());
|
||||||
|
|
||||||
const auto label = lifetime().make_state<rpl::event_stream<QLocale>>();
|
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(
|
const auto translateSkip = Settings::AddButtonWithLabel(
|
||||||
topContainer,
|
translateSkipWrap->entity(),
|
||||||
tr::lng_translate_settings_choose(),
|
tr::lng_translate_settings_choose(),
|
||||||
label->events() | rpl::map(Ui::LanguageName),
|
label->events() | rpl::map(Ui::LanguageName),
|
||||||
st::settingsButtonNoIcon);
|
st::settingsButtonNoIcon);
|
||||||
|
@ -1177,6 +1185,10 @@ void LanguageBox::prepare() {
|
||||||
accumulate_max(*max, height);
|
accumulate_max(*max, height);
|
||||||
setDimensions(st::boxWidth, qMin(*max, st::boxMaxListHeight));
|
setDimensions(st::boxWidth, qMin(*max, st::boxMaxListHeight));
|
||||||
}, inner->lifetime());
|
}, inner->lifetime());
|
||||||
|
topContainer->heightValue(
|
||||||
|
) | rpl::start_with_next([=](int height) {
|
||||||
|
setInnerTopSkip(height);
|
||||||
|
}, inner->lifetime());
|
||||||
|
|
||||||
select->setSubmittedCallback([=](Qt::KeyboardModifiers) {
|
select->setSubmittedCallback([=](Qt::KeyboardModifiers) {
|
||||||
inner->activateBySubmit();
|
inner->activateBySubmit();
|
||||||
|
|
Loading…
Add table
Reference in a new issue