Attempt to fix the naturalWidth feature.

This commit is contained in:
John Preston
2025-08-11 19:25:01 +04:00
parent c939eda7bb
commit b2fb2d5821
42 changed files with 414 additions and 388 deletions

View File

@@ -4147,14 +4147,15 @@ void InnerWidget::refreshEmpty() {
.name = u"no_chats"_q,
.sizeOverride = Size(st::changePhoneIconSize),
});
_emptyList->add(
object_ptr<Ui::CenterWrap<>>(_emptyList, std::move(icon.widget)));
_emptyList->add(std::move(icon.widget), {}, style::al_top);
Ui::AddSkip(_emptyList);
_emptyList->add(
object_ptr<Ui::FlatLabel>(
_emptyList,
tr::lng_no_conversations(),
st::dialogEmptyButtonLabel));
st::dialogEmptyButtonLabel),
{},
style::al_top);
if (_state == WidgetState::Default) {
icon.animate(anim::repeat::once);
}

View File

@@ -170,30 +170,32 @@ void PostsSearchIntro::setup() {
_content.get(),
std::move(title),
st::postsSearchIntroTitle),
st::postsSearchIntroTitleMargin);
st::postsSearchIntroTitleMargin,
style::al_top);
_title->setTryMakeSimilarLines(true);
_subtitle = _content->add(
object_ptr<Ui::FlatLabel>(
_content.get(),
std::move(subtitle),
st::postsSearchIntroSubtitle),
st::postsSearchIntroSubtitleMargin);
st::postsSearchIntroSubtitleMargin,
style::al_top);
_subtitle->setTryMakeSimilarLines(true);
_button = _content->add(
object_ptr<Ui::CenterWrap<Ui::RoundButton>>(
object_ptr<Ui::RoundButton>(
_content.get(),
object_ptr<Ui::RoundButton>(
_content.get(),
rpl::single(QString()),
st::postsSearchIntroButton))
)->entity();
rpl::single(QString()),
st::postsSearchIntroButton),
{},
style::al_top);
_button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
_footer = _content->add(
object_ptr<Ui::FlatLabel>(
_content.get(),
std::move(footer),
st::postsSearchIntroFooter),
st::postsSearchIntroFooterMargin);
st::postsSearchIntroFooterMargin,
style::al_top);
_footer->setTryMakeSimilarLines(true);
_state.value(