Show "No languages found." label.

This commit is contained in:
John Preston 2022-03-01 19:27:42 +03:00
parent 5ad2900c9c
commit cfa60df134
1 changed files with 24 additions and 0 deletions

View File

@ -907,6 +907,30 @@ void Content::setupContent(
content,
object_ptr<Ui::BoxContentDivider>(content)));
const auto other = add(official, true);
const auto empty = content->add(
object_ptr<Ui::SlideWrap<Ui::FixedHeightWidget>>(
content,
object_ptr<Ui::FixedHeightWidget>(
content,
st::membersAbout.style.font->height * 9)));
const auto label = Ui::CreateChild<Ui::FlatLabel>(
empty->entity(),
tr::lng_languages_none(),
st::membersAbout);
empty->entity()->sizeValue(
) | rpl::start_with_next([=](QSize size) {
label->move(
(size.width() - label->width()) / 2,
(size.height() - label->height()) / 2);
}, label->lifetime());
empty->toggleOn(
rpl::combine(
main ? main->isEmpty() : rpl::single(true),
other ? other->isEmpty() : rpl::single(true),
_1 && _2),
anim::type::instant);
Ui::ResizeFitChild(this, content);
if (main && other) {