mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-23 10:47:11 +00:00
Show informative empty posts search.
This commit is contained in:
parent
86cffae001
commit
60f6ea3252
@ -117,7 +117,9 @@ void PostsSearch::pushStateUpdate(const Entry &entry) {
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!entry.pages.empty() || entry.loaded) {
|
const auto empty = entry.pages.empty()
|
||||||
|
|| (entry.pages.size() == 1 && entry.pages.front().empty());
|
||||||
|
if (!empty || (entry.loaded && !_query->isEmpty())) {
|
||||||
if (!entry.pages.empty()) {
|
if (!entry.pages.empty()) {
|
||||||
++entry.pagesPushed;
|
++entry.pagesPushed;
|
||||||
}
|
}
|
||||||
|
@ -2020,6 +2020,10 @@ void Suggestions::setupPostsIntro(const PostsSearchIntroState &intro) {
|
|||||||
}
|
}
|
||||||
}, _postsSearchIntro->lifetime());
|
}, _postsSearchIntro->lifetime());
|
||||||
|
|
||||||
|
_postsScroll->heightValue() | rpl::start_with_next([=](int height) {
|
||||||
|
_postsWrap->resize(_postsWrap->width(), height);
|
||||||
|
}, _postsSearchIntro->lifetime());
|
||||||
|
|
||||||
_postsSearchIntro->show();
|
_postsSearchIntro->show();
|
||||||
updateControlsGeometry();
|
updateControlsGeometry();
|
||||||
}
|
}
|
||||||
|
@ -198,6 +198,12 @@ void PostsSearchIntro::setup() {
|
|||||||
|
|
||||||
_state.value(
|
_state.value(
|
||||||
) | rpl::start_with_next([=](const PostsSearchIntroState &state) {
|
) | rpl::start_with_next([=](const PostsSearchIntroState &state) {
|
||||||
|
if (state.query.trimmed().isEmpty()) {
|
||||||
|
_button->resize(_button->width(), 0);
|
||||||
|
_content->resizeToWidth(width());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
auto copy = _button->children();
|
auto copy = _button->children();
|
||||||
for (const auto child : copy) {
|
for (const auto child : copy) {
|
||||||
delete child;
|
delete child;
|
||||||
@ -232,6 +238,7 @@ void PostsSearchIntro::setup() {
|
|||||||
st::resaleButtonTitle,
|
st::resaleButtonTitle,
|
||||||
st::resaleButtonSubtitle);
|
st::resaleButtonSubtitle);
|
||||||
}
|
}
|
||||||
|
_button->resize(_button->width(), st::postsSearchIntroButton.height);
|
||||||
_content->resizeToWidth(width());
|
_content->resizeToWidth(width());
|
||||||
}, _button->lifetime());
|
}, _button->lifetime());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user